UIK050101.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. namespace Core.LZMes.Client.UIK
  13. {
  14. public partial class UIK050101 : FrmBase
  15. {
  16. public UIK050101()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query"://查询
  25. this.DoQuery();
  26. break;
  27. case "Insert"://添加换下轧辊实绩
  28. this.DoInsert();
  29. break;
  30. case "Update"://下发换下轧辊实绩
  31. this.DoUpdate();
  32. break;
  33. }
  34. }
  35. private void DoQuery()
  36. {
  37. try
  38. {
  39. string zgNum = "";
  40. string beginTime = "";
  41. string endTime = "";
  42. bool flag = false;
  43. CoreClientParam ccp = new CoreClientParam();
  44. CoreClientParam ccp2 = new CoreClientParam();
  45. DataTable dt = new DataTable();
  46. DataTable dt2 = new DataTable();
  47. if (this.ultraCheckEditor1.Checked)
  48. {
  49. //this.ultraTextzgNum.Clear();
  50. //this.ultraCheckEditor1.Checked = false;
  51. //ccp.ServerName = "UIK.UIK05.UIK050030";
  52. //ccp.MethodName = "DoQueryShang";
  53. //ccp.ServerParams = new object[] { zgNum, flag ,beginTime,endTime};
  54. //ccp.SourceDataTable = dt;
  55. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  56. //this.ultraGrid1.DataSource = dt;
  57. //CoreClientParam ccp = new CoreClientParam();
  58. //ccp.ServerName = "UIM.UIM010040";
  59. //ccp.MethodName = "queryCoilStatus";
  60. //ccp.ServerParams = new object[] { coilNo };
  61. //ccp.SourceDataTable = this.dataSet1.Tables[0];
  62. //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  63. //if (dt.Rows.Count <= 0)
  64. //{
  65. // MessageBox.Show("暂无记录!");
  66. //}
  67. //return;
  68. }
  69. else
  70. {
  71. zgNum = this.ultraTextzgNum.Text;
  72. beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  73. endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
  74. this.dataSet1.Clear();
  75. // this.ultraTextzgNum.Clear();
  76. // this.ultraCheckEditor1.Checked = false;
  77. ccp.ServerName = "UIK.UIK05.UIK050101";
  78. ccp.MethodName = "DoQuery";
  79. ccp.ServerParams = new object[] { zgNum, beginTime, endTime, beginTime, endTime };
  80. ccp.SourceDataTable = this.dataSet1.Tables[0];
  81. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  82. }
  83. }
  84. // }
  85. catch (Exception Ex)
  86. {
  87. MessageBox.Show(Ex.ToString());
  88. }
  89. }
  90. private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
  91. {
  92. try
  93. {
  94. if (this.ultraCheckEditor1.Checked)
  95. {
  96. this.ultraTextzgNum.Enabled = false;
  97. }
  98. if (!this.ultraCheckEditor1.Checked)
  99. {
  100. this.ultraTextzgNum.Enabled = true;
  101. }
  102. }
  103. catch (Exception Ex)
  104. {
  105. MessageBox.Show(Ex.ToString());
  106. }
  107. }
  108. private void DoInsert()
  109. {
  110. try
  111. {
  112. if (this.ultraTextStand_id.Text == "")
  113. {
  114. MessageBox.Show("轧辊编号必须填写!");
  115. }
  116. else
  117. {
  118. // string spec_No = this.ultraTextSpec_no.Text;
  119. string roll_num = this.ultraTextStand_id.Text; //轧辊编号
  120. string daima = this.ultraTextEditor3.Text;//
  121. string cucaodu = this.ultraTextEditor6.Text; //轧辊区域
  122. string kaishizhijing = this.ultraTextShangID.Text;//上编号
  123. string jieshuzhijing = this.ultraTextXiaBian.Text;//下编号
  124. string ruandian = this.ultraTextEditor2.Text;//时间
  125. string moxueliang = this.ultraTextEditor4.Text;//原因 ------
  126. string chuangbianhao = this.ultraTextEditor5.Text;//轧制长度
  127. string yingdu = this.ultraTextEditor1.Text;//轧制量
  128. string kaishi = this.ultraCalendarDis_time.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.ultraCalendarDis_time.Text.ToString();
  129. string jieshu = this.dateTimePicker1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.dateTimePicker1.Text.ToString();
  130. string gunxing=this.ultraTextEditor9.Text;
  131. string yuandu=this.ultraTextEditor7.Text;
  132. string liewen = this.ultraTextEditor8.Text;
  133. System.DateTime dtt = System.DateTime.Now;
  134. string spec_No = (string.Format("{0:yyyyMMddHHmmss}", dtt)).Substring(8,6);
  135. CoreClientParam ccp = new CoreClientParam();
  136. ccp.ServerName = "UIK.UIK05.UIK050101";
  137. ccp.MethodName = "PlanAdd";
  138. ccp.ServerParams = new object[] { roll_num, daima, cucaodu, kaishizhijing, jieshuzhijing, ruandian, moxueliang, chuangbianhao, yingdu, kaishi, jieshu ,gunxing,yuandu,liewen};
  139. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  140. //if (0 != ccp.ReturnCode) return;
  141. if (0 != ccp.ReturnCode)
  142. {
  143. MessageBox.Show("添加失败");
  144. }
  145. else
  146. {
  147. MessageBox.Show("添加成功");
  148. this.ultraTextStand_id.Clear();
  149. //this.ultraComboType.Clear();
  150. // this.ultraComboArea.Clear();
  151. this.ultraTextShangID.Clear();
  152. this.ultraTextXiaBian.Clear();
  153. //this.ultraComboEditor1.Clear();
  154. this.ultraTextEditor2.Clear();
  155. this.ultraTextEditor1.Clear();
  156. }
  157. // }
  158. }
  159. }
  160. catch (Exception Ex)
  161. {
  162. MessageBox.Show(Ex.ToString());
  163. }
  164. }
  165. private void ultraGrid1_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
  166. {
  167. Infragistics.Win.UltraWinGrid.UltraGrid uGrid = (Infragistics.Win.UltraWinGrid.UltraGrid)sender;
  168. ultraTextStand_id.Text = uGrid.ActiveRow.Cells["ROLL_NUMBER"].Text;
  169. ultraTextEditor3.Text = uGrid.ActiveRow.Cells["PROGRAM_NUMBE"].Text;//磨削程序代码
  170. ultraTextEditor6.Text = uGrid.ActiveRow.Cells["ROUGHNESS"].Text;//粗糙度
  171. ultraTextShangID.Text = uGrid.ActiveRow.Cells["ROLL_DIAMETER_MD_BEFORE"].Text;//磨前直径
  172. ultraTextEditor2.Text = uGrid.ActiveRow.Cells["BRUISEMAX"].Text;//软点
  173. ultraTextEditor4.Text = uGrid.ActiveRow.Cells["GRIND_AMOUNT"].Text;//磨削量
  174. ultraTextEditor5.Text = uGrid.ActiveRow.Cells["STATION_NO"].Text;//辊床编号
  175. ultraTextXiaBian.Text = uGrid.ActiveRow.Cells["ROLL_DIAMETER_MD_AFTER"].Text;//磨后直径
  176. ultraTextEditor1.Text = uGrid.ActiveRow.Cells["HARDNESS_MD"].Text;//硬度
  177. //ultraCalendarDis_time.Text = uGrid.ActiveRow.Cells["GRIND_START_TIME"].Text;//磨前直径
  178. //dateTimePicker1.Text = uGrid.ActiveRow.Cells["GRIND_END_TIME"].Text;//软点
  179. ultraTextEditor9.Text = uGrid.ActiveRow.Cells["ROLL_TYPE"].Text;//辊型
  180. ultraTextEditor7.Text = uGrid.ActiveRow.Cells["ROLL_ROUNDNESS"].Text;//圆度
  181. ultraTextEditor8.Text = uGrid.ActiveRow.Cells["CRACKMAX"].Text;//裂纹
  182. }
  183. private void DoUpdate()
  184. {
  185. try
  186. {
  187. ArrayList al = new ArrayList();
  188. ArrayList list = new ArrayList();
  189. list.Add("UIK050101_01.UPDATE");
  190. string roll_num = this.ultraTextStand_id.Text; //轧辊编号
  191. string daima = this.ultraTextEditor3.Text;//
  192. string cucaodu = this.ultraTextEditor6.Text; //轧辊区域
  193. string kaishizhijing = this.ultraTextShangID.Text;//上编号
  194. string jieshuzhijing = this.ultraTextXiaBian.Text;//下编号
  195. string ruandian = this.ultraTextEditor2.Text;//软点
  196. string moxueliang = this.ultraTextEditor4.Text;//原因 ------
  197. string chuangbianhao = this.ultraTextEditor5.Text;//轧制长度
  198. string yingdu = this.ultraTextEditor1.Text;//轧制量
  199. // string kaishi = this.ultraCalendarDis_time.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.ultraCalendarDis_time.Text.ToString();
  200. // string jieshu = this.dateTimePicker1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : ""; //this.dateTimePicker1.Text.ToString();
  201. string gunxing = this.ultraTextEditor9.Text;
  202. string yuandu = this.ultraTextEditor7.Text;
  203. string liewen = this.ultraTextEditor8.Text;
  204. string beginTime = ultraDateTimeEditor1.Value != null ? ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") : "";
  205. string endTime = ultraDateTimeEditor2.Value != null ? ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") : "";
  206. //
  207. list.Add(daima);
  208. list.Add(cucaodu);
  209. list.Add(kaishizhijing);
  210. list.Add(ruandian);
  211. list.Add(moxueliang);
  212. list.Add(chuangbianhao);
  213. list.Add(jieshuzhijing);
  214. list.Add(yingdu);
  215. list.Add(gunxing);
  216. list.Add(yuandu);
  217. list.Add(liewen);
  218. list.Add(roll_num);
  219. list.Add(beginTime);
  220. list.Add(endTime);
  221. al.Add(list);
  222. if (al.Count == 0)
  223. {
  224. MessageBox.Show("请勾选数据再做保存操作!", "提示");
  225. return;
  226. }
  227. CoreClientParam ccp = new CoreClientParam();
  228. ccp.ServerName = "UIB.COM.ComDBSave";
  229. ccp.MethodName = "doXmlSave";
  230. ccp.ServerParams = new object[] { al };
  231. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  232. this.DoQuery();
  233. //CoreClientParam ccp2 = new CoreClientParam();
  234. //ccp2.ServerName = "UIK.UIK05.UIK050030";
  235. //ccp2.MethodName = "DoUpdate";
  236. ////ccp2.ServerParams = new object[] { spec_No, sand_Id, roll_Type, roll_Area, roll_Id_up, roll_Id_lo, z_time, reason, banci, banbie, s_chang, s_liang, s_shi, x_chang, x_liang, x_shi, create_time, uid };
  237. //ccp2.ServerParams = new object[] { reason, zhazhiliang, zhazhicd, timexg, number, iddown, idup, namerg };
  238. //ccp2 = this.ExecuteNonQuery(ccp2, CoreInvokeType.Internal);
  239. if (0 != ccp.ReturnCode)
  240. {
  241. MessageBox.Show("保存失败!");
  242. }
  243. else
  244. {
  245. MessageBox.Show("保存成功!");
  246. }
  247. }
  248. catch (Exception Ex)
  249. {
  250. MessageBox.Show(Ex.ToString());
  251. }
  252. }
  253. private void UIK050101_Load(object sender, EventArgs e)
  254. {
  255. }
  256. }
  257. }