frmworkhis.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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 frmworkhis : FrmLgDevFunctions
  13. {
  14. public string potno = "";
  15. private DataSet _dsMain;
  16. public frmworkhis(OpeBase oba)
  17. {
  18. InitializeComponent();
  19. this.chkTime.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
  20. ob = oba;
  21. }
  22. private void frmworkhis_Load(object sender, EventArgs e)
  23. {
  24. txtNoLadle.Text = potno;
  25. this.chkTime.Checked = true;
  26. Refreshworkhis();
  27. }
  28. private void Refreshworkhis()
  29. {
  30. string sqlstr = "";
  31. try
  32. {
  33. if (potno != "")
  34. {
  35. sqlstr = string.Format("where LADLEID='{0}'", this.txtNoLadle.Text.Trim());
  36. }
  37. else
  38. {
  39. sqlstr = "where 1 = 1";
  40. }
  41. if (this.chkTime.Checked)
  42. {
  43. sqlstr += string.Format(" and to_char(OPTDATE,'yyyy-MM-dd') between '{0}' and '{1}' ", this.udteStart.DateTime.ToString("yyyy-MM-dd"), this.udteEnd.DateTime.ToString("yyyy-MM-dd"));
  44. }
  45. _dsMain = QueryToFunions("Core.LgMes.Server.LgDeviceManager.potmanger", "Getworkhisdata", sqlstr,ob);
  46. try
  47. {
  48. ((DataSet)uGrdkHIS.DataSource).Tables[0].Rows.Clear();
  49. }
  50. catch (Exception)
  51. {
  52. }
  53. if (_dsMain.Tables[0].Rows.Count > 0)
  54. {
  55. this.uGrdkHIS.DataSource = _dsMain;
  56. }
  57. }
  58. catch { }
  59. }
  60. private void InitData1()
  61. {
  62. try
  63. {
  64. UltraGridBand band = this.uGrdkHIS.DisplayLayout.Bands[0];
  65. band.Columns[0].Header.Caption = "钢包号";
  66. band.Columns[0].Width = 80;
  67. band.Columns[1].Header.Caption = "炉号";
  68. band.Columns[1].Width = 80;
  69. band.Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  70. band.Columns[2].Header.Caption = "钢种";
  71. band.Columns[2].Width = 80;
  72. band.Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  73. band.Columns[3].Header.Caption = "状态";
  74. band.Columns[3].Width = 80;
  75. band.Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  76. band.Columns[4].Header.Caption = "等级";
  77. band.Columns[4].Width = 80;
  78. band.Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  79. band.Columns[5].Header.Caption = "包龄";
  80. band.Columns[5].Width = 80;
  81. band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  82. band.Columns[5].Header.Caption = "班组";
  83. band.Columns[5].Width = 80;
  84. band.Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  85. band.Columns[6].Header.Caption = "转炉座号";
  86. band.Columns[6].Width = 80;
  87. band.Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  88. band.Columns[7].Header.Caption = "出钢开始";
  89. band.Columns[7].Width = 150;
  90. band.Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  91. band.Columns[7].Format = "yyyy-MM-dd HH:mm:ss";
  92. band.Columns[8].Header.Caption = "出刚结束";
  93. band.Columns[8].Width = 150;
  94. band.Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  95. band.Columns[8].Format = "yyyy-MM-dd HH:mm:ss";
  96. band.Columns[9].Header.Caption = "出钢时间";
  97. band.Columns[9].Width = 80;
  98. band.Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  99. band.Columns[10].Header.Caption = "LF座号";
  100. band.Columns[10].Width = 80;
  101. band.Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  102. band.Columns[11].Header.Caption = "LF开始";
  103. band.Columns[11].Width = 150;
  104. band.Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  105. band.Columns[11].Format = "yyyy-MM-dd HH:mm:ss";
  106. band.Columns[12].Header.Caption = "LF结束";
  107. band.Columns[12].Width = 150;
  108. band.Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  109. band.Columns[12].Format = "yyyy-MM-dd HH:mm:ss";
  110. band.Columns[13].Header.Caption = "精炼时间";
  111. band.Columns[13].Width = 80;
  112. band.Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  113. band.Columns[14].Header.Caption = "氩站座号";
  114. band.Columns[14].Width = 80;
  115. band.Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  116. band.Columns[15].Header.Caption = "吹氩开始";
  117. band.Columns[15].Width = 150;
  118. band.Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  119. band.Columns[15].Format = "yyyy-MM-dd HH:mm:ss";
  120. band.Columns[16].Header.Caption = "吹氩结束";
  121. band.Columns[16].Width = 150;
  122. band.Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  123. band.Columns[16].Format = "yyyy-MM-dd HH:mm:ss";
  124. band.Columns[17].Header.Caption = "吹氩时间";
  125. band.Columns[17].Width = 80;
  126. band.Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  127. band.Columns[18].Header.Caption = "RH座号";
  128. band.Columns[18].Width = 80;
  129. band.Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  130. band.Columns[18].Hidden = true;
  131. band.Columns[19].Header.Caption = "真空开始";
  132. band.Columns[19].Width = 150;
  133. band.Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  134. band.Columns[19].Format = "yyyy-MM-dd HH:mm:ss";
  135. band.Columns[19].Hidden = true;
  136. band.Columns[20].Header.Caption = "真空结束";
  137. band.Columns[20].Width = 150;
  138. band.Columns[20].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  139. band.Columns[20].Format = "yyyy-MM-dd HH:mm:ss";
  140. band.Columns[20].Hidden = true;
  141. band.Columns[21].Header.Caption = "真空时间";
  142. band.Columns[21].Width = 80;
  143. band.Columns[21].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  144. band.Columns[21].Hidden = true;
  145. band.Columns[22].Header.Caption = "铸机号";
  146. band.Columns[22].Width = 80;
  147. band.Columns[22].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  148. band.Columns[23].Header.Caption = "浇铸开始";
  149. band.Columns[23].Width = 150;
  150. band.Columns[23].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  151. band.Columns[23].Format = "yyyy-MM-dd HH:mm:ss";
  152. band.Columns[24].Header.Caption = "浇铸结束";
  153. band.Columns[24].Width = 150;
  154. band.Columns[24].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  155. band.Columns[24].Format = "yyyy-MM-dd HH:mm:ss";
  156. band.Columns[25].Header.Caption = "浇铸时间";
  157. band.Columns[25].Width = 80;
  158. band.Columns[25].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  159. band.Columns[26].Header.Caption = "是否引流";
  160. band.Columns[26].Width = 80;
  161. band.Columns[26].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  162. }
  163. catch
  164. { }
  165. }
  166. private void checkBox3_CheckedChanged(object sender, EventArgs e)
  167. {
  168. this.udteStart.Enabled = this.chkTime.Checked;
  169. this.udteEnd.Enabled = this.chkTime.Checked;
  170. }
  171. private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
  172. {
  173. switch (e.ClickedItem.Name)
  174. {
  175. case "QUERY":
  176. {
  177. potno = this.txtNoLadle.Text.Trim();
  178. Refreshworkhis();
  179. break;
  180. }
  181. case "ALL":
  182. {
  183. potno = "";
  184. Refreshworkhis();
  185. break;
  186. }
  187. case "EXPORT":
  188. {
  189. try
  190. {
  191. Core.Mes.Client.Common.Globals.ulGridToExcel(uGrdkHIS, Text);
  192. }
  193. catch (Exception ex)
  194. {
  195. MessageBox.Show(ex.Message);
  196. }
  197. break;
  198. }
  199. case "CLOSE":
  200. {
  201. this.Close();
  202. break;
  203. }
  204. default:
  205. break;
  206. }
  207. }
  208. }
  209. }