QCM0205ZHB.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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. using Newtonsoft.Json;
  13. using Newtonsoft.Json.Linq;
  14. using Infragistics.Win;
  15. using System.Diagnostics;
  16. namespace Core.LZMes.Client.QCM
  17. {
  18. public partial class QCM0205ZHB : FrmBase
  19. {
  20. #region 初始变量
  21. public string specimenNo = "";//取样编号
  22. public string smpNo = "";//试样号
  23. public string plineCode = "";//产线
  24. #endregion
  25. #region 初始化
  26. public QCM0205ZHB()
  27. {
  28. InitializeComponent();
  29. }
  30. //初始化的时候加载列
  31. private void QCM0205ZHB_Load(object sender, EventArgs e)
  32. {
  33. this.sel_BATCH_NO.Focus();
  34. tabPage3.Parent = null;
  35. tabPage4.Parent = null;
  36. tabPage5.Parent = null;
  37. ValueList v = new ValueList();
  38. v.ValueListItems.Add("A", "热处理之前(勾选)");
  39. v.ValueListItems.Add("B", "热处理之后(不勾选)");
  40. v.ValueListItems.Add("AB", "热处理前/后");
  41. if (plineCode.Equals("ZB1"))
  42. {
  43. tabPage1.Parent = null;
  44. this.ultraGrid2.DisplayLayout.Bands[0].Columns["SAMPLINGREQUESTTIME"].ValueList = v.Clone();
  45. }
  46. else if (plineCode.Equals("HB1"))
  47. {
  48. tabPage2.Parent = null;
  49. this.ultraGrid1.DisplayLayout.Bands[0].Columns["SAMPLINGREQUESTTIME"].ValueList = v.Clone();
  50. }
  51. }
  52. #endregion
  53. #region 功能
  54. public override void ToolBar_Click(object sender, string ToolbarKey)
  55. {
  56. switch (ToolbarKey)
  57. {
  58. case "Query":
  59. //this.DoQuery();
  60. break;
  61. case "Add":
  62. //this.DoAdd();
  63. break;
  64. }
  65. }
  66. #region 查询
  67. private void button1_Click(object sender, EventArgs e)
  68. {
  69. if (tabControl1.SelectedTab.Text.Equals("厚板线"))
  70. {
  71. this.DoKchTurnofFlist();//厚板线
  72. }
  73. else if (tabControl1.SelectedTab.Text.Equals("中板线"))
  74. {
  75. this.DoKczTurnofFlist();//中板线
  76. }
  77. else if (tabControl1.SelectedTab.Text.Equals("高棒线"))
  78. {
  79. this.DoKcxTurnofFlist();//高棒线
  80. }
  81. else if (tabControl1.SelectedTab.Text.Equals("热轧线"))
  82. {
  83. this.DoTbcTurnofFlist();//热轧线
  84. }
  85. else if (tabControl1.SelectedTab.Text.Equals("连退线"))
  86. {
  87. this.DoCtbcTurnofFlist();//连退线
  88. }
  89. }
  90. #region 厚板线
  91. private void DoKchTurnofFlist()
  92. {
  93. try
  94. {
  95. this.dataSet1.Clear();
  96. string selDesignKey = this.sel_DESIGN_KEY.Text.Trim(); //销售订单号
  97. string selHeatNo = this.sel_HEAT_NO.Text.Trim(); //炉号
  98. string selBatchNo = this.sel_BATCH_NO.Text.Trim(); //轧批号
  99. //if (selBatchNo == null || selBatchNo.Equals(""))
  100. //{
  101. // this.alert("【厚板线】请输入轧批号");
  102. // this.sel_BATCH_NO.Focus();
  103. // return;
  104. //}
  105. //查询数据库里的数据
  106. CoreClientParam ccp = new CoreClientParam();
  107. DataTable datatable = new DataTable();
  108. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  109. ccp.MethodName = "getKchTurnofFlist";
  110. ccp.SourceDataTable = this.dataSet1.Tables[0];
  111. ccp.ServerParams = new object[] { selDesignKey, selHeatNo, selBatchNo };
  112. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  113. }
  114. catch (Exception ex)
  115. {
  116. System.Diagnostics.Debug.WriteLine(ex.ToString());
  117. MessageBox.Show("系统出错,请联系管理人员", "警告");
  118. }
  119. }
  120. #endregion
  121. #region 中板线
  122. private void DoKczTurnofFlist()
  123. {
  124. try
  125. {
  126. this.dataSet2.Clear();
  127. string selDesignKey = this.sel_DESIGN_KEY.Text.Trim(); //销售订单号
  128. string selHeatNo = this.sel_HEAT_NO.Text.Trim(); //炉号
  129. string selBatchNo = this.sel_BATCH_NO.Text.Trim(); //轧批号
  130. //if (selBatchNo == null || selBatchNo.Equals(""))
  131. //{
  132. // this.alert("【中板线】请输入轧批号");
  133. // this.sel_BATCH_NO.Focus();
  134. // return;
  135. //}
  136. //查询数据库里的数据
  137. CoreClientParam ccp = new CoreClientParam();
  138. DataTable datatable = new DataTable();
  139. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  140. ccp.MethodName = "getKczTurnofFlist";
  141. ccp.SourceDataTable = this.dataSet2.Tables[0];
  142. ccp.ServerParams = new object[] { selDesignKey, selHeatNo, selBatchNo };
  143. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  144. //foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  145. //{
  146. // ugr.Cells["ALLPHYTESTNAMES2"].Value = ugr.Cells["ALLPHYTESTNAMES2"].Value.ToString();
  147. //}
  148. }
  149. catch (Exception ex)
  150. {
  151. System.Diagnostics.Debug.WriteLine(ex.ToString());
  152. MessageBox.Show("系统出错,请联系管理人员", "警告");
  153. }
  154. }
  155. #endregion
  156. #region 高棒线
  157. private void DoKcxTurnofFlist()
  158. {
  159. try
  160. {
  161. this.dataSet3.Clear();
  162. string selDesignKey = this.sel_DESIGN_KEY.Text.Trim(); //销售订单号
  163. string selHeatNo = this.sel_HEAT_NO.Text.Trim(); //炉号
  164. string selBatchNo = this.sel_BATCH_NO.Text.Trim(); //轧批号
  165. if (selBatchNo == null || selBatchNo.Equals(""))
  166. {
  167. this.alert("【高棒线】请输入轧批号8位");
  168. this.sel_BATCH_NO.Focus();
  169. return;
  170. }
  171. //查询数据库里的数据
  172. CoreClientParam ccp = new CoreClientParam();
  173. DataTable datatable = new DataTable();
  174. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  175. ccp.MethodName = "getKcxTurnofFlist";
  176. ccp.SourceDataTable = this.dataSet3.Tables[0];
  177. ccp.ServerParams = new object[] { selDesignKey, selHeatNo, selBatchNo };
  178. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  179. }
  180. catch (Exception ex)
  181. {
  182. System.Diagnostics.Debug.WriteLine(ex.ToString());
  183. MessageBox.Show("系统出错,请联系管理人员", "警告");
  184. }
  185. }
  186. #endregion
  187. #region 热轧线
  188. private void DoTbcTurnofFlist()
  189. {
  190. try
  191. {
  192. this.dataSet4.Clear();
  193. string selDesignKey = this.sel_DESIGN_KEY.Text.Trim(); //销售订单号
  194. string selHeatNo = this.sel_HEAT_NO.Text.Trim(); //炉号
  195. string selBatchNo = this.sel_BATCH_NO.Text.Trim(); //轧批号
  196. if (selBatchNo == null || selBatchNo.Equals(""))
  197. {
  198. this.alert("【热轧线】请输入正确轧批号!");
  199. this.sel_BATCH_NO.Focus();
  200. return;
  201. }
  202. //查询数据库里的数据
  203. CoreClientParam ccp = new CoreClientParam();
  204. DataTable datatable = new DataTable();
  205. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  206. ccp.MethodName = "getHotRoll";
  207. ccp.SourceDataTable = this.dataSet4.Tables[0];
  208. ccp.ServerParams = new object[] { selDesignKey, selHeatNo, selBatchNo };
  209. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  210. }
  211. catch (Exception ex)
  212. {
  213. System.Diagnostics.Debug.WriteLine(ex.ToString());
  214. MessageBox.Show("系统出错,请联系管理人员", "警告");
  215. }
  216. }
  217. #endregion
  218. #region 连退线
  219. private void DoCtbcTurnofFlist()
  220. {
  221. try
  222. {
  223. this.dataSet5.Clear();
  224. string selDesignKey = this.sel_DESIGN_KEY.Text.Trim(); //销售订单号
  225. string selHeatNo = this.sel_HEAT_NO.Text.Trim(); //炉号
  226. string selBatchNo = this.sel_BATCH_NO.Text.Trim(); //轧批号
  227. if (selBatchNo == null || selBatchNo.Equals(""))
  228. {
  229. this.alert("【连退线】请输入正确轧批号!");
  230. this.sel_BATCH_NO.Focus();
  231. return;
  232. }
  233. //查询数据库里的数据
  234. CoreClientParam ccp = new CoreClientParam();
  235. DataTable datatable = new DataTable();
  236. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  237. ccp.MethodName = "getRetreat";
  238. ccp.SourceDataTable = this.dataSet5.Tables[0];
  239. ccp.ServerParams = new object[] { selDesignKey, selHeatNo, selBatchNo };
  240. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  241. }
  242. catch (Exception ex)
  243. {
  244. System.Diagnostics.Debug.WriteLine(ex.ToString());
  245. MessageBox.Show("系统出错,请联系管理人员", "警告");
  246. }
  247. }
  248. #endregion
  249. #endregion
  250. #region 新增
  251. private void button2_Click(object sender, EventArgs e)
  252. {
  253. this.DoAdd();
  254. }
  255. private void DoAdd()
  256. {
  257. try
  258. {
  259. String tabname = "厚板线";
  260. UltraGrid ug = this.ultraGrid1;
  261. if (tabControl1.SelectedTab.Text.Equals("厚板线"))
  262. {
  263. tabname = "厚板线";
  264. ug = this.ultraGrid1;
  265. }
  266. else if (tabControl1.SelectedTab.Text.Equals("中板线"))
  267. {
  268. tabname = "中板线";
  269. ug = this.ultraGrid2;
  270. }
  271. else if (tabControl1.SelectedTab.Text.Equals("高棒线"))
  272. {
  273. tabname = "高棒线";
  274. ug = this.ultraGrid3;
  275. }
  276. else if (tabControl1.SelectedTab.Text.Equals("热轧线"))
  277. {
  278. tabname = "热轧线";
  279. ug = this.ultraGrid4;
  280. }
  281. else if (tabControl1.SelectedTab.Text.Equals("连退线"))
  282. {
  283. tabname = "连退线";
  284. ug = this.ultraGrid5;
  285. }
  286. if (checkBox1.Checked && checkBox2.Checked)
  287. {
  288. this.alert("勾选了性能改善!请勾选热处理之前/之后");
  289. return;
  290. }
  291. StringBuilder sb = new StringBuilder("[");
  292. Dictionary<string, string> openWith = new Dictionary<string, string>();
  293. int tf = 0;
  294. foreach (UltraGridRow row in ug.Rows)
  295. {
  296. if (row.Cells["check"].Value.ToString().ToLower() == "true")
  297. {
  298. if (tf == 0)
  299. {
  300. openWith.Add("INSPECTION_LOT", row.Cells["INSPECTION_LOT"].Value.ToString());//检验号
  301. openWith.Add("DESIGN_KEY", row.Cells["DESIGN_KEY"].Value.ToString());//销售订单号
  302. openWith.Add("PSC", row.Cells["PSC"].Value.ToString());//产品码
  303. openWith.Add("HEAT_NO", row.Cells["HEAT_NO"].Value.ToString());//炉号
  304. openWith.Add("BATCH_NO", row.Cells["BATCH_NO"].Value.ToString());//轧批号
  305. openWith.Add("BOARD_NO", row.Cells["BOARD_NO"].Value.ToString());//母板号
  306. openWith.Add("GRADE_CODE", row.Cells["GRADE_CODE"].Value.ToString());//炼钢牌号代码
  307. openWith.Add("GRADE_NAME", row.Cells["GRADE_NAME"].Value.ToString());//炼钢牌号名称
  308. openWith.Add("MATERIAL_NO", row.Cells["MATERIAL_NO"].Value.ToString());//产品序号
  309. openWith.Add("MSC_PLINE", row.Cells["MSC_PLINE"].Value.ToString());//全程产线号
  310. openWith.Add("PLINE_CODE", row.Cells["PLINE_CODE"].Value.ToString());//产线代码
  311. openWith.Add("PLINE_NAME", row.Cells["PLINE_NAME"].Value.ToString());//产线名称
  312. openWith.Add("DELIVERY_STATE_CODE", row.Cells["DELIVERY_STATE_CODE"].Value.ToString());//交货状态代码
  313. openWith.Add("DELIVERY_STATE_DESC", row.Cells["DELIVERY_STATE_DESC"].Value.ToString());//交货状态描述
  314. openWith.Add("PROCESS_CODE", row.Cells["PROCESS_CODE"].Value.ToString());//工序代码
  315. openWith.Add("THICK", row.Cells["THICK"].Value.ToString());
  316. openWith.Add("WIDTH", row.Cells["WIDTH"].Value.ToString());//
  317. openWith.Add("LENGTH", row.Cells["LENGTH"].Value.ToString());
  318. openWith.Add("IS_QTLY", row.Cells["IS_QTLY"].Value.ToString());//是否需要材质检验
  319. openWith.Add("IS_CHEM", row.Cells["IS_CHEM"].Value.ToString());//是否需要成品成分检验
  320. openWith.Add("TYPE", row.Cells["TYPE"].Value.ToString());//请求类型
  321. openWith.Add("USER_NAME", this.UserInfo.GetUserName());
  322. //性能改善
  323. if (checkBox2.Checked)
  324. {
  325. openWith.Add("MEMO", "性能改善");//备注信息
  326. String RCL_STATE = row.Cells["RCL_STATE"].Value.ToString();
  327. //if (!RCL_STATE.Contains("G"))
  328. //{
  329. // this.alert("当前热处理号【" + RCL_STATE + "】最后一位不为G,最后一位为G代表需要性能改善");
  330. // return;
  331. //}
  332. }else {
  333. openWith.Add("MEMO", row.Cells["MEMO"].Value.ToString());//备注信息
  334. }
  335. if (tabControl1.SelectedTab.Text.Equals("高棒线"))
  336. {
  337. openWith.Add("WEIGHT", row.Cells["WEIGHT"].Value.ToString());//总重量
  338. openWith.Add("WEIGHT_STD", row.Cells["WEIGHT_STD"].Value.ToString());//上限值
  339. openWith.Add("WEIGHT_SFD", row.Cells["WEIGHT_SFD"].Value.ToString());//浮动值
  340. }
  341. if (tabname.Equals("厚板线") || tabname.Equals("中板线"))
  342. {
  343. openWith.Add("WEIGHT", row.Cells["LRAWEGHT"].Value.ToString());//LRA总重量
  344. String samplin = row.Cells["SAMPLINGREQUESTTIME"].Value.ToString();
  345. if (checkBox1.Checked || samplin.Equals("A"))
  346. {
  347. if (tabname.Equals("厚板线"))
  348. {
  349. openWith.Add("HTPROCESS_CODE", "HB1");//初样
  350. }
  351. else
  352. {
  353. openWith.Add("HTPROCESS_CODE", "ZB1");//初样
  354. }
  355. }
  356. else if (checkBox3.Checked || checkBox2.Checked)
  357. {
  358. openWith.Add("HTPROCESS_CODE", "HTZB1");//热处理
  359. }
  360. else
  361. {
  362. openWith.Add("HTPROCESS_CODE", "HT1");//热处理之后 力学
  363. }
  364. }
  365. sb.Append(JsonConvert.SerializeObject(openWith));
  366. }
  367. if (tf != 0)
  368. {
  369. sb.Append(",");
  370. openWith["INSPECTION_LOT"] = row.Cells["INSPECTION_LOT"].Value.ToString();//检验号
  371. openWith["DESIGN_KEY"] = row.Cells["DESIGN_KEY"].Value.ToString();//销售订单号
  372. openWith["PSC"] = row.Cells["PSC"].Value.ToString();//产品码
  373. openWith["HEAT_NO"] = row.Cells["HEAT_NO"].Value.ToString();//炉号
  374. openWith["BATCH_NO"] = row.Cells["BATCH_NO"].Value.ToString();//轧批号
  375. openWith["BOARD_NO"] = row.Cells["BOARD_NO"].Value.ToString();//母板号
  376. openWith["GRADE_CODE"] = row.Cells["GRADE_CODE"].Value.ToString();//炼钢牌号代码
  377. openWith["GRADE_NAME"] = row.Cells["GRADE_NAME"].Value.ToString();//炼钢牌号名称
  378. openWith["MATERIAL_NO"] = row.Cells["MATERIAL_NO"].Value.ToString();//产品序号
  379. openWith["MSC_PLINE"] = row.Cells["MSC_PLINE"].Value.ToString();//全程产线号
  380. openWith["PLINE_CODE"] = row.Cells["PLINE_CODE"].Value.ToString();//产线代码
  381. openWith["PLINE_NAME"] = row.Cells["PLINE_NAME"].Value.ToString();//产线名称
  382. openWith["DELIVERY_STATE_CODE"] = row.Cells["DELIVERY_STATE_CODE"].Value.ToString();//交货状态代码
  383. openWith["DELIVERY_STATE_DESC"] = row.Cells["DELIVERY_STATE_DESC"].Value.ToString();//交货状态描述
  384. openWith["PROCESS_CODE"] = row.Cells["PROCESS_CODE"].Value.ToString();//工序代码
  385. openWith["THICK"] = row.Cells["THICK"].Value.ToString();
  386. openWith["WIDTH"] = row.Cells["WIDTH"].Value.ToString();//
  387. openWith["LENGTH"] = row.Cells["LENGTH"].Value.ToString();
  388. openWith["IS_QTLY"] = row.Cells["IS_QTLY"].Value.ToString();//是否需要材质检验
  389. openWith["IS_CHEM"] = row.Cells["IS_CHEM"].Value.ToString();//是否需要成品成分检验
  390. openWith["TYPE"] = row.Cells["TYPE"].Value.ToString();//请求类型
  391. openWith["USER_NAME"] = this.UserInfo.GetUserName();
  392. //性能改善
  393. if (checkBox2.Checked)
  394. {
  395. openWith.Add("MEMO", "性能改善");//备注信息
  396. String RCL_STATE = row.Cells["RCL_STATE"].Value.ToString();
  397. //if (!RCL_STATE.Contains("G"))
  398. //{
  399. // this.alert("当前热处理号【" + RCL_STATE + "】最后一位不为G,最后一位为G代表需要性能改善");
  400. // return;
  401. //}
  402. }
  403. else
  404. {
  405. openWith["MEMO"] = row.Cells["MEMO"].Value.ToString();//备注信息
  406. }
  407. if (tabControl1.SelectedTab.Text.Equals("高棒线"))
  408. {
  409. openWith["WEIGHT"] = row.Cells["WEIGHT"].Value.ToString();//总重量
  410. openWith["WEIGHT_STD"] = row.Cells["WEIGHT_STD"].Value.ToString();//上限值
  411. openWith["WEIGHT_SFD"] = row.Cells["WEIGHT_SFD"].Value.ToString();//浮动值
  412. }
  413. if (tabname.Equals("厚板线") || tabname.Equals("中板线"))
  414. {
  415. openWith["WEIGHT"] = row.Cells["LRAWEGHT"].Value.ToString();//LRA总重量
  416. String samplin = row.Cells["SAMPLINGREQUESTTIME"].Value.ToString();
  417. if (checkBox1.Checked || samplin.Equals("A"))
  418. {
  419. if (tabname.Equals("厚板线"))
  420. {
  421. openWith["HTPROCESS_CODE"] = "HB1";//初样
  422. }
  423. else
  424. {
  425. openWith["HTPROCESS_CODE"] = "ZB1";//初样
  426. }
  427. }
  428. else if (checkBox3.Checked || checkBox2.Checked)
  429. {
  430. openWith["HTPROCESS_CODE"] = "HTZB1";
  431. }
  432. else
  433. {
  434. openWith["HTPROCESS_CODE"] = "HT1";//热处理之后
  435. }
  436. }
  437. sb.Append(JsonConvert.SerializeObject(openWith));
  438. }
  439. tf = tf + 1;
  440. }
  441. }
  442. sb.Append("]");
  443. string sbb = sb.ToString();
  444. //查询是否已经委托
  445. String retun ="0";
  446. retun = selEntrust(sbb);
  447. if (retun.Equals("1"))
  448. {
  449. if (MessageBox.Show("选择的数据当中有已经委托并且未发送,您确实要从新生成委托吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  450. {
  451. return;
  452. }
  453. }
  454. //JArray jo = (JArray)JsonConvert.DeserializeObject(sbb);
  455. //查询数据库里的数据
  456. CoreClientParam ccp = new CoreClientParam();
  457. DataTable datatable = new DataTable();
  458. // ccp.ServerName = "QCM.JHY01.JHY0101.AddAutoSample";
  459. // ccp.MethodName = "doGenerationSampleInfo";
  460. ccp.ServerName = "QCM.JHY01.JHY0101.AutoSample";
  461. ccp.MethodName = "doGenerationSampleInfo";
  462. ccp.ServerParams = new object[] { sbb, tabname };
  463. ccp.SourceDataTable = this.dataSet2.Tables[0];
  464. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  465. if (ccp.ReturnCode != -1)
  466. {
  467. MessageBox.Show("委托成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
  468. this.Close();
  469. }
  470. }
  471. catch (Exception ex)
  472. {
  473. System.Diagnostics.Debug.WriteLine(ex.ToString());
  474. MessageBox.Show("系统出错,请联系管理人员", "警告");
  475. }
  476. }
  477. #endregion
  478. #endregion
  479. #region 其它事件
  480. #region 查询人工委托中是否已经有委托了
  481. public String selEntrust(String date)
  482. {
  483. String returnnum = "0";
  484. //查询数据库里的数据
  485. CoreClientParam ccp = new CoreClientParam();
  486. DataTable datatable = new DataTable();
  487. ccp.ServerName = "QCM.JHY01.JHY0101.QuerryQltySample";
  488. ccp.MethodName = "selEntrust";
  489. ccp.ServerParams = new object[] { date };
  490. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  491. if (ccp.ReturnCode != 0)
  492. {
  493. returnnum = "1";//1代表已经有委托 并且没有下发
  494. }
  495. return returnnum;
  496. }
  497. #endregion
  498. #region 更新事件
  499. private void ultraGrid1_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  500. {
  501. ultraGrid1.UpdateData();
  502. }
  503. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  504. {
  505. ultraGrid1.UpdateData();
  506. }
  507. private void ultraGrid2_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  508. {
  509. ultraGrid2.UpdateData();
  510. }
  511. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  512. {
  513. ultraGrid2.UpdateData();
  514. }
  515. private void ultraGrid3_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  516. {
  517. ultraGrid3.UpdateData();
  518. }
  519. private void ultraGrid3_CellChange(object sender, CellEventArgs e)
  520. {
  521. ultraGrid3.UpdateData();
  522. }
  523. private void ultraGrid4_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  524. {
  525. ultraGrid4.UpdateData();
  526. }
  527. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  528. {
  529. ultraGrid4.UpdateData();
  530. }
  531. private void ultraGrid5_AfterHeaderCheckStateChanged(object sender, AfterHeaderCheckStateChangedEventArgs e)
  532. {
  533. ultraGrid5.UpdateData();
  534. }
  535. private void ultraGrid5_CellChange(object sender, CellEventArgs e)
  536. {
  537. ultraGrid5.UpdateData();
  538. }
  539. #endregion
  540. #region tab切换点击事件
  541. private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
  542. {
  543. //if (tabControl1.SelectedTab.Text.Equals("厚板线"))
  544. //{
  545. // //执行相应的操作
  546. // DoKchTurnofFlist();
  547. //}
  548. //else if (tabControl1.SelectedTab.Text.Equals("中板线"))
  549. //{
  550. // //执行相应的操作
  551. // DoKczTurnofFlist();
  552. //}
  553. //else if (tabControl1.SelectedTab.Text.Equals("高棒线"))
  554. //{
  555. // DoKcxTurnofFlist();
  556. //}
  557. //else if (tabControl1.SelectedTab.Text.Equals("热轧线"))
  558. //{
  559. // this.DoTbcTurnofFlist();//热轧线
  560. //}
  561. //else if (tabControl1.SelectedTab.Text.Equals("连退线"))
  562. //{
  563. // this.DoCtbcTurnofFlist();//连退线
  564. //}
  565. }
  566. #endregion
  567. private void checkBox2_Click(object sender, EventArgs e)
  568. {
  569. if (checkBox2.Checked)
  570. {
  571. checkBox3.Checked = true;
  572. }
  573. }
  574. #endregion
  575. }
  576. }