6f77eb71e1a3a087b7defaac8ce6462621ec72fc.svn-base 27 KB

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