QCM0205ZHB2.cs 29 KB

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