frmhothis.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Data;
  3. using System.Drawing;
  4. using System.Collections;
  5. using System.ComponentModel;
  6. using System.Windows.Forms;
  7. using System.Diagnostics;
  8. using Infragistics.Win.UltraWinGrid;
  9. using CoreFS.CA06;
  10. namespace Core.LgMes.Client.LgDeviceManager
  11. {
  12. public partial class frmhothis : FrmLgDevFunctions
  13. {
  14. public frmhothis(OpeBase oba)
  15. {
  16. InitializeComponent();
  17. ob = oba;
  18. }
  19. private DataSet _dsMain;
  20. public string potno = "1";
  21. private void frmhothis_Load(object sender, EventArgs e)
  22. {
  23. this.txtNoLadle.Text = potno;
  24. this.uDTEStart.DateTime = DateTime.Today;
  25. this.uDTEEnd.DateTime = DateTime.Today;
  26. GetTableData();
  27. InitData1();
  28. }
  29. /// <summary>
  30. /// 查询
  31. /// </summary>
  32. private void GetTableData()
  33. {
  34. string strFrom = this.uDTEStart.DateTime.ToString("yyyyMMdd");
  35. string strTo = this.uDTEEnd.DateTime.ToString("yyyyMMdd");
  36. string strWhere = " to_char(BEGINTIME,'yyyyMMdd') between '" + strFrom + "' and '" + strTo + "' ";
  37. if (potno != "")
  38. {
  39. strWhere +=" and FIRINGTOOLID = '"+potno+"'";
  40. }
  41. try
  42. {
  43. _dsMain =QueryToFunions("Core.LgMes.Server.LgDeviceManager.potmanger", "GetHotRecLog",strWhere,ob);
  44. try
  45. {
  46. ((DataSet)uGrdhothis.DataSource).Tables[0].Rows.Clear();
  47. }
  48. catch (Exception)
  49. {
  50. }
  51. if (_dsMain.Tables[0].Rows.Count > 0)
  52. {
  53. this.uGrdhothis.DataSource = _dsMain;
  54. }
  55. }
  56. catch (Exception ex)
  57. {
  58. string strMsg = ex.Message;
  59. }
  60. }
  61. /// <summary>
  62. /// UltraGrid显示设置
  63. /// </summary>
  64. private void InitData1()
  65. {
  66. try
  67. {
  68. UltraGridBand band = this.uGrdhothis.DisplayLayout.Bands[0];
  69. band.Columns[0].Header.Caption = "钢包号";
  70. band.Columns[0].Width = 60;
  71. band.Columns[1].Header.Caption = "烘烤位置";
  72. band.Columns[1].Width = 60;
  73. band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  74. band.Columns[2].Header.Caption = "开始时间";
  75. band.Columns[2].Width = 150;
  76. band.Columns[2].CellAppearance.ForeColor = Color.Black;
  77. band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  78. band.Columns[3].Header.Caption = "结束时间";
  79. band.Columns[3].Width = 150;
  80. band.Columns[3].CellAppearance.ForeColor = Color.Black;
  81. band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  82. band.Columns[4].Header.Caption = "烘烤时间";
  83. band.Columns[4].Width = 65;
  84. band.Columns[4].CellAppearance.ForeColor = Color.Black;
  85. band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  86. }
  87. catch
  88. { }
  89. }
  90. /// <summary>
  91. /// 窗体菜单
  92. /// </summary>
  93. /// <param name="sender"></param>
  94. /// <param name="e"></param>
  95. private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  96. {
  97. switch (e.ClickedItem.Name)
  98. {
  99. case "QUERY":
  100. {
  101. potno = this.txtNoLadle.Text.Trim();
  102. GetTableData();
  103. break;
  104. }
  105. case "ALL":
  106. {
  107. potno = "";
  108. GetTableData();
  109. break;
  110. }
  111. case "EXPORT":
  112. {
  113. try
  114. {
  115. Core.Mes.Client.Common.Globals.ulGridToExcel(uGrdhothis, Text);
  116. }
  117. catch (Exception ex)
  118. {
  119. MessageBox.Show(ex.Message);
  120. }
  121. break;
  122. }
  123. case "CLOSE":
  124. {
  125. this.Close();
  126. break;
  127. }
  128. default:
  129. break;
  130. }
  131. }
  132. }
  133. }