FrmBackSlab.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  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 Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Infragistics.Win;
  14. using com.steering.mes.zgmil.entity;
  15. using System.Collections;
  16. using Core.Mes.Client.Comm.Tool;
  17. using Core.StlMes.Client.ZGMil.Entity;
  18. using Core.StlMes.Client.ZGMil.Signature;
  19. using Core.StlMes.Client.ZGMil.Common;
  20. namespace Core.StlMes.Client.ZGMil.Popup
  21. {
  22. public partial class FrmBackSlab : FrmBase
  23. {
  24. private UltraGridRow ActUgr = null;
  25. private string ActContractNo = "";
  26. private UltraGridRow ActUgr1 = null;
  27. FeedRowPlan Feedplan = new FeedRowPlan();
  28. private string ActJudgeStoveNo = "";
  29. private string ActID = "";
  30. private string proPlanId = null;//轧管订单编号
  31. private string gxPlanNo = null;//工序排产序号
  32. private string _UserName = "";
  33. private string _Shift = "";
  34. private string _Group = "";
  35. private string _PlineCode = "";
  36. private OpeBase _ob;
  37. public FrmBackSlab(string Shift, string Group, string User, OpeBase ob, string PlineCode)
  38. {
  39. InitializeComponent();
  40. _Shift = Shift;
  41. _Group = Group;
  42. _UserName = User;
  43. _ob = ob;
  44. _PlineCode = PlineCode;
  45. BackSlabQuery();
  46. BlacPlanQuery();
  47. }
  48. /// <summary>
  49. /// 页面加载事件
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. protected override void OnLoad(EventArgs e)
  54. {
  55. base.OnLoad(e);
  56. ultraGrid_GHDL.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  57. chkNodeQuery.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  58. ultraGrid2.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  59. ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
  60. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.getContractNo", new object[] { _PlineCode }, this._ob);
  61. cmbContrack.DataSource = dt;
  62. cmbContrack.ValueMember = "contract_no";
  63. cmbContrack.DisplayMember = "contract_no";
  64. //TubeRoll.SetComboItemHeight(cmbContrack);
  65. //天淮508机组产线自动生成炉号
  66. if (_PlineCode.Equals("C072"))
  67. {
  68. ultraLabel1.Visible = false;
  69. ultraLabel2.Visible = false;
  70. txtZPLotNo.Visible = false;
  71. txtZPJudgeNo.Visible = false;
  72. }
  73. }
  74. /// <summary>
  75. /// 待组回炉坯查询按钮
  76. /// </summary>
  77. /// <param name="sender"></param>
  78. /// <param name="e"></param>
  79. private void btnQuery_Click(object sender, EventArgs e)
  80. {
  81. if (chkContractNo.Checked)
  82. {
  83. if (string.IsNullOrEmpty(txtContractNo.Text))
  84. {
  85. MessageBox.Show("请输入需查询的合同号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  86. return;
  87. }
  88. }
  89. BackSlabQuery();
  90. }
  91. /// <summary>
  92. /// 已组回炉坯查询按钮
  93. /// </summary>
  94. /// <param name="sender"></param>
  95. /// <param name="e"></param>
  96. private void ultraButton2_Click(object sender, EventArgs e)
  97. {
  98. if (chkContractNo1.Checked)
  99. {
  100. if (string.IsNullOrEmpty(txtContractNo1.Text))
  101. {
  102. MessageBox.Show("请输入需查询的合同号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  103. return;
  104. }
  105. }
  106. if (this.chkJudgeNo1.Checked)
  107. {
  108. if (string.IsNullOrEmpty(this.txtJudgeStoveNo.Text))
  109. {
  110. MessageBox.Show("请输入需查询的炉号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  111. return;
  112. }
  113. }
  114. if (this.chkLotNo1.Checked)
  115. {
  116. if (string.IsNullOrEmpty(this.txtLotNo.Text))
  117. {
  118. MessageBox.Show("请输入需查询的批号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  119. return;
  120. }
  121. }
  122. BlacPlanQuery();
  123. }
  124. /// <summary>
  125. /// 初始化控件
  126. /// </summary>
  127. private void InitCol()
  128. {
  129. if (chkContractNo.Checked)
  130. {
  131. txtContractNo.Enabled = true;
  132. }
  133. else
  134. {
  135. txtContractNo.Enabled = false;
  136. }
  137. if (chkSteelName.Checked)
  138. {
  139. txtSteelName.Enabled = true;
  140. }
  141. else
  142. {
  143. txtSteelName.Enabled = false;
  144. }
  145. if (chkLength.Checked)
  146. {
  147. txtLength.Enabled = true;
  148. }
  149. else
  150. {
  151. txtLength.Enabled = false;
  152. }
  153. if (chkSection.Checked)
  154. {
  155. txtSection.Enabled = true;
  156. }
  157. else
  158. {
  159. txtSection.Enabled = false;
  160. }
  161. if (chkLotNo1.Checked)
  162. {
  163. txtLotNo.Enabled = true;
  164. }
  165. else
  166. {
  167. txtLotNo.Enabled = false;
  168. }
  169. if (chkJudgeNo1.Checked)
  170. {
  171. txtJudgeStoveNo.Enabled = true;
  172. }
  173. else
  174. {
  175. txtJudgeStoveNo.Enabled = false;
  176. }
  177. if (chkContractNo1.Checked)
  178. {
  179. txtContractNo1.Enabled = true;
  180. }
  181. else
  182. {
  183. txtContractNo1.Enabled = false;
  184. }
  185. if (chkDate.Checked )
  186. {
  187. this.udtDate.Enabled = true;
  188. }
  189. else
  190. {
  191. this.udtDate.Enabled = false;
  192. }
  193. }
  194. /// <summary>
  195. /// Grid记录更改颜色
  196. /// </summary>
  197. private void ChangeGridColor()
  198. {
  199. foreach (UltraGridRow ugr in ultraGrid2.Rows)
  200. {
  201. if (ugr.Cells["STATUS"].Value.ToString() != "00")
  202. {
  203. ugr.Appearance.BackColor = Color.YellowGreen;
  204. }
  205. }
  206. }
  207. /// <summary>
  208. /// 回炉坯合同查询
  209. /// </summary>
  210. private void BackSlabQuery()
  211. {
  212. string Key1 = "";
  213. string Key2 = "";
  214. string Key3 = "";
  215. // string ContractNo = "";
  216. string Length = "";
  217. string SteelName = "";
  218. string Section = "";
  219. string date = "";
  220. UltraGridRow ugr = this.chkNodeQuery.ActiveRow;
  221. if (ugr != null)
  222. {
  223. Key1 = ugr.Cells["GRADENAME"].Value.ToString();
  224. Key2 = ugr.Cells["DB_LENGTH"].Value.ToString();
  225. Key3 = ugr.Cells["PIPE_SECTION"].Value.ToString();
  226. }
  227. //if (chkContractNo.Checked == true)
  228. //{
  229. // ContractNo = this.txtContractNo.Text;
  230. //}
  231. //else
  232. //{
  233. // ContractNo = "";
  234. //}
  235. if (chkDate.Checked == true)
  236. {
  237. date = DateTime.Parse(this.udtDate.Value.ToString()).ToString("yyyyMMdd");
  238. }
  239. else
  240. {
  241. date = "";
  242. }
  243. if (chkSteelName.Checked == true)
  244. {
  245. SteelName = this.txtSteelName.Text;
  246. }
  247. else
  248. {
  249. SteelName = "";
  250. }
  251. if (chkLength.Checked == true)
  252. {
  253. Length = this.txtLength.Text;
  254. }
  255. else
  256. {
  257. Length = "";
  258. }
  259. if (chkSection.Checked == true)
  260. {
  261. Section = this.txtSection.Text;
  262. }
  263. else
  264. {
  265. Section = "";
  266. }
  267. dtContratNo.Clear();
  268. dataTable1.Clear();
  269. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.getContractNo", new object[] { SteelName, Length, Section, _PlineCode, date }, this._ob);
  270. GridHelper.CopyDataToDatatable(ref dt, ref dtContratNo, true);
  271. if (dt.Rows.Count > 0)
  272. {
  273. if (ugr != null)
  274. {
  275. foreach (UltraGridRow ugr1 in chkNodeQuery.Rows)
  276. {
  277. if (ugr1.Cells["GRADENAME"].Value.ToString() == Key1 && ugr1.Cells["DB_LENGTH"].Value.ToString() == Key2 && ugr1.Cells["PIPE_SECTION"].Value.ToString() == Key3)
  278. {
  279. ugr1.Activated = true;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. /// <summary>
  286. /// 已组回炉坯计划查询
  287. /// </summary>
  288. private void BlacPlanQuery()
  289. {
  290. string PrimaKey = "";
  291. string JudgeStoveNo = "";
  292. string LotNo = "";
  293. string ContractNo = "";
  294. string Flag = "0";
  295. UltraGridRow ugr = this.ultraGrid2.ActiveRow;
  296. if (ugr != null)
  297. {
  298. PrimaKey = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  299. }
  300. if (chkLotNo1.Checked == true)
  301. {
  302. LotNo = this.txtLotNo.Text;
  303. }
  304. else
  305. {
  306. LotNo = "";
  307. }
  308. if (chkJudgeNo1.Checked == true)
  309. {
  310. JudgeStoveNo = this.txtJudgeStoveNo.Text;
  311. }
  312. else
  313. {
  314. JudgeStoveNo = "";
  315. }
  316. if (chkContractNo1.Checked == true)
  317. {
  318. ContractNo = this.txtContractNo1.Text;
  319. }
  320. else
  321. {
  322. ContractNo = "";
  323. }
  324. if (chkIsStart.Checked == true)
  325. {
  326. Flag = "1";
  327. }
  328. else
  329. {
  330. Flag = "0";
  331. }
  332. dtBackPlan.Clear();
  333. dataTable2.Clear();
  334. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.getBackSlabPlan", new object[] { JudgeStoveNo, LotNo, ContractNo, Flag, _PlineCode }, this._ob);
  335. GridHelper.CopyDataToDatatable(ref dt, ref dtBackPlan, true);
  336. if (dt.Rows.Count > 0)
  337. {
  338. if (ugr != null)
  339. {
  340. foreach (UltraGridRow ugr1 in ultraGrid2.Rows)
  341. {
  342. if (ugr1.Cells["JUDGE_STOVE_NO"].Value.ToString() == PrimaKey)
  343. {
  344. ugr1.Activated = true;
  345. }
  346. }
  347. }
  348. }
  349. ChangeGridColor();
  350. }
  351. /// <summary>
  352. /// 合同、计划激活行单击事件
  353. /// </summary>
  354. /// <param name="sender"></param>
  355. /// <param name="e"></param>
  356. private void chkNodeQuery_AfterRowActivate(object sender, EventArgs e)
  357. {
  358. if (chkNodeQuery.ActiveRow == null)
  359. {
  360. return;
  361. }
  362. else
  363. {
  364. ActUgr = chkNodeQuery.ActiveRow;
  365. //ActContractNo = ActUgr.Cells["CONTRACT_NO"].Value.ToString();
  366. string Length = ActUgr.Cells["DB_LENGTH"].Value.ToString();
  367. string GradeName = ActUgr.Cells["GRADENAME"].Value.ToString();
  368. string Section = ActUgr.Cells["PIPE_SECTION"].Value.ToString();
  369. dataTable1.Clear();
  370. ugbColClear();
  371. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.getBackSlabForContractNo", new object[] { GradeName, Length, Section, _PlineCode }, this._ob);
  372. GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
  373. }
  374. }
  375. /// <summary>
  376. /// 已组炉计划激活行单击事件
  377. /// </summary>
  378. /// <param name="sender"></param>
  379. /// <param name="e"></param>
  380. private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
  381. {
  382. if (ultraGrid2.ActiveRow == null)
  383. {
  384. return;
  385. }
  386. ActUgr1 = ultraGrid2.ActiveRow;
  387. ActJudgeStoveNo = ActUgr1.Cells["JUDGE_STOVE_NO"].Value.ToString();
  388. proPlanId = ActUgr1.Cells["PRO_PLAN_ID"].Value.ToString();
  389. gxPlanNo = ActUgr1.Cells["GX_PLAN_NO"].Value.ToString();
  390. ActID = ActUgr1.Cells["ID"].Value.ToString();
  391. dataTable2.Clear();
  392. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.getBackSlabForJudgeStoveNo", new object[] { ActJudgeStoveNo }, this._ob);
  393. GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
  394. }
  395. private void chkContractNo_CheckedChanged(object sender, EventArgs e)
  396. {
  397. if (chkContractNo.Checked)
  398. {
  399. txtContractNo.Enabled = true;
  400. }
  401. else
  402. {
  403. txtContractNo.Enabled = false;
  404. }
  405. if (chkLotNo1.Checked)
  406. {
  407. txtLotNo.Enabled = true;
  408. }
  409. else
  410. {
  411. txtLotNo.Enabled = false;
  412. }
  413. if (chkJudgeNo1.Checked)
  414. {
  415. txtJudgeStoveNo.Enabled = true;
  416. }
  417. else
  418. {
  419. txtJudgeStoveNo.Enabled = false;
  420. }
  421. if (chkContractNo1.Checked)
  422. {
  423. txtContractNo1.Enabled = true;
  424. }
  425. else
  426. {
  427. txtContractNo1.Enabled = false;
  428. }
  429. if (chkSteelName.Checked)
  430. {
  431. txtSteelName.Enabled = true;
  432. }
  433. else
  434. {
  435. txtSteelName.Enabled = false;
  436. }
  437. if (chkLength.Checked)
  438. {
  439. txtLength.Enabled = true;
  440. }
  441. else
  442. {
  443. txtLength.Enabled = false;
  444. }
  445. if (chkSection.Checked)
  446. {
  447. txtSection.Enabled = true;
  448. }
  449. else
  450. {
  451. txtSection.Enabled = false;
  452. }
  453. if (chkDate.Checked)
  454. {
  455. this.udtDate.Enabled = true;
  456. }
  457. else
  458. {
  459. this.udtDate.Enabled = false;
  460. }
  461. }
  462. /// <summary>
  463. /// 组炉回退
  464. /// </summary>
  465. /// <param name="sender"></param>
  466. /// <param name="e"></param>
  467. private void ultraButton1_Click(object sender, EventArgs e)
  468. {
  469. if (ultraGrid2.ActiveRow == null)
  470. {
  471. return;
  472. }
  473. if (ultraGrid2.ActiveRow.Cells["STATUS"].Value.ToString() != "00")
  474. {
  475. MessageBox.Show("炉号【" + BaseMethod.getJudgeStoveNo(ActJudgeStoveNo) + "】已开始轧制,不能回退", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  476. return;
  477. }
  478. if (MessageUtil.ShowYesNoAndQuestion("确认炉号【" + BaseMethod.getJudgeStoveNo(ActJudgeStoveNo) + "】回退?") == DialogResult.No)
  479. {
  480. return;
  481. }
  482. string ValueList = "";
  483. if (ultraGrid1.Rows.Count > 1)
  484. {
  485. int i = 1;
  486. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  487. {
  488. if (i == 1)
  489. {
  490. ValueList += "( '" + ugr.Cells["MAT_NO"].Value.ToString() + "'";
  491. }
  492. else if (i == ultraGrid1.Rows.Count)
  493. {
  494. ValueList += ",'" + ugr.Cells["MAT_NO"].Value.ToString() + "')";
  495. }
  496. else
  497. {
  498. ValueList += ",'" + ugr.Cells["MAT_NO"].Value.ToString() + "'";
  499. }
  500. i++;
  501. }
  502. }
  503. else
  504. {
  505. ValueList += "( '" + ultraGrid1.ActiveRow.Cells["MAT_NO"].Value.ToString() + "')";
  506. }
  507. int Count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmHotCheck.BackFurSlab", new object[] { ActJudgeStoveNo, ActID, ValueList, proPlanId, gxPlanNo }, this._ob);
  508. //MessageBox.Show("回退成功。");
  509. BlacPlanQuery();
  510. }
  511. //勾选主炉号的行
  512. public static List<UltraGridRow> UltraGridGetCHKMAINRows(UltraGrid grid, string columnName = "CHKMAIN")
  513. {
  514. grid.UpdateData();
  515. List<UltraGridRow> list = new List<UltraGridRow>();
  516. RowsCollection rows = grid.Rows;
  517. foreach (var item in rows)
  518. {
  519. try
  520. {
  521. if (Convert.ToBoolean(item.Cells[columnName].Value) == true && item.Hidden == false && item.IsFilteredOut == false)
  522. {
  523. list.Add(item);
  524. }
  525. }
  526. catch { }
  527. }
  528. return list;
  529. }
  530. /// <summary>
  531. /// 回炉坯组炉
  532. /// </summary>
  533. /// <param name="sender"></param>
  534. /// <param name="e"></param>
  535. private void btnZP_Click(object sender, EventArgs e)
  536. {
  537. if (chkNodeQuery.ActiveRow == null)
  538. {
  539. return;
  540. }
  541. string JudgeStoveNo = "";
  542. string proPlanId1 = "";
  543. string gxPlanNo1 = "";
  544. string ValueList = "";
  545. string contractNo = "";//修改合同号
  546. string RollLength = "";//修改轧制长度
  547. string RESULT_NO = "";
  548. if (ckrContrack.Checked)
  549. {
  550. if (cmbContrack.Value.Equals(""))
  551. {
  552. MessageBox.Show("请输入或选择合同号号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  553. return;
  554. }
  555. else {
  556. contractNo = cmbContrack.Value.ToString();
  557. }
  558. }
  559. if (ckrRollLength.Checked)
  560. {
  561. if (cmbRollLength.Text.Trim().ToString().Equals(""))
  562. {
  563. MessageBox.Show("请输入或选择合同号号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  564. return;
  565. }
  566. else
  567. {
  568. RollLength = cmbRollLength.Text.Trim().ToString();
  569. }
  570. }
  571. //天淮508机组产线自动生成炉号
  572. if (_PlineCode.Equals("C072"))
  573. {
  574. List<UltraGridRow> list = UltraGridGetCHKMAINRows(ultraGrid_GHDL);
  575. if (list.Count == 0) {
  576. MessageBox.Show("请勾选主炉生产批号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  577. return;
  578. }
  579. //批号
  580. txtZPLotNo.Text = list[0].Cells["LOT_NO"].Value.ToString();
  581. //炉号
  582. txtZPJudgeNo.Text = ServerHelper.GetData("com.steering.mes.signature.FrmDownlineManage.doQueryZpJudgeStoveNo", new Object[] { "D" }, this.ob).Rows[0][0].ToString();
  583. }
  584. else
  585. {
  586. if (string.IsNullOrEmpty(txtZPJudgeNo.Text))
  587. {
  588. MessageBox.Show("请输入回炉坯组炉炉号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  589. return;
  590. }
  591. if (string.IsNullOrEmpty(this.txtZPLotNo.Text))
  592. {
  593. MessageBox.Show("请输入回炉坯组炉批号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  594. return;
  595. }
  596. if (txtZPJudgeNo.Text.Trim().Length != 6)
  597. {
  598. MessageBox.Show("请输入6位组炉炉号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  599. return;
  600. }
  601. }
  602. //查询该炉号是否已经存在
  603. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.IsUsedJudgeStoveNo", new object[] { txtZPJudgeNo.Text + "-01" }, this._ob);
  604. if (dt.Rows.Count > 0)
  605. {
  606. MessageBox.Show("炉号【" + txtZPJudgeNo.Text + "】已存在,请更换组炉炉号!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  607. return;
  608. }
  609. ultraGrid_GHDL.UpdateData();
  610. IQueryable<UltraGridRow> urows = ultraGrid_GHDL.Rows.AsQueryable().Where("CHK = 'True'");
  611. int MatNum = urows.Count();
  612. if (MatNum == 0)
  613. {
  614. MessageBox.Show("请选择需要组炉的回炉坯料!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  615. return;
  616. }
  617. int i = 1;
  618. if (MatNum > 1)
  619. {
  620. string CONTRACT_NO = "";
  621. foreach (UltraGridRow ugr in urows)
  622. {
  623. if (CONTRACT_NO.Equals(""))
  624. {
  625. CONTRACT_NO = ugr.Cells["CONTRACT_NO"].Value.ToString();
  626. }
  627. else
  628. {
  629. if (!ugr.Cells["CONTRACT_NO"].Value.ToString().Equals(CONTRACT_NO))
  630. {
  631. MessageBox.Show("合同号不一致,不允许组炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  632. return;
  633. }
  634. }
  635. //查询组炉的炉号之前是不是回炉坯炉号
  636. DataTable dtZp = ServerHelper.GetData("com.steering.mes.zgmil.coup.FrmHotCheck.IsZpJudgeStoveNo", new object[] { ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() }, this._ob);
  637. if (dtZp.Rows.Count > 0)
  638. {
  639. MessageBox.Show("炉号【" + ugr.Cells["JUDGE_STOVE_NO"].Value.ToString() + "】是回炉坯炉号,不允许再次组炉!", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  640. return;
  641. }
  642. if (i == 1)
  643. {
  644. JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  645. proPlanId1 = ugr.Cells["PRO_PLAN_ID"].Value.ToString();
  646. gxPlanNo1 = ugr.Cells["GX_PLAN_NO"].Value.ToString();
  647. RESULT_NO = ugr.Cells["RESULT_NO"].Value.ToString();
  648. ValueList += "( '" + ugr.Cells["MAT_NO"].Value.ToString() + "'";
  649. }
  650. else if (i == MatNum)
  651. {
  652. ValueList += ",'" + ugr.Cells["MAT_NO"].Value.ToString() + "')";
  653. }
  654. else
  655. {
  656. ValueList += ",'" + ugr.Cells["MAT_NO"].Value.ToString() + "'";
  657. }
  658. i++;
  659. }
  660. }
  661. else
  662. {
  663. JudgeStoveNo = ultraGrid_GHDL.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
  664. proPlanId1 = ultraGrid_GHDL.ActiveRow.Cells["PRO_PLAN_ID"].Value.ToString();
  665. gxPlanNo1 = ultraGrid_GHDL.ActiveRow.Cells["GX_PLAN_NO"].Value.ToString();
  666. RESULT_NO = ultraGrid_GHDL.ActiveRow.Cells["RESULT_NO"].Value.ToString();
  667. ValueList += "( '" + ultraGrid_GHDL.ActiveRow.Cells["MAT_NO"].Value.ToString() + "')";
  668. }
  669. Feedplan.ResultNo = RESULT_NO;
  670. Feedplan.LotNo = txtZPLotNo.Text;
  671. Feedplan.JudgeStoveNo = txtZPJudgeNo.Text + "-01";
  672. Feedplan.StoveNo = "";
  673. Feedplan.PlineCode = _PlineCode;
  674. Feedplan.ProPlanId = proPlanId1;
  675. Feedplan.GxPlanNo = gxPlanNo1;
  676. int Count = ServerHelper.SetData("com.steering.mes.zgmil.coup.FrmHotCheck.BackSlabGroup", new object[] { JudgeStoveNo, txtZPJudgeNo.Text, txtZPLotNo.Text, MatNum, ValueList, _UserName, _Shift, _Group, contractNo, RollLength, proPlanId1, gxPlanNo1, Feedplan }, this._ob);
  677. if (Count > 0)
  678. {
  679. MessageBox.Show("组炉成功。");
  680. }
  681. BackSlabQuery();
  682. }
  683. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  684. {
  685. BackSlabQuery();
  686. BlacPlanQuery();
  687. }
  688. private void chkDate_CheckedChanged(object sender, EventArgs e)
  689. {
  690. if (ckrContrack.Checked) { cmbContrack.Enabled = true; } else { cmbContrack.Enabled = false; }
  691. if (ckrRollLength.Checked) { cmbRollLength.Enabled = true; } else { cmbRollLength.Enabled = false; }
  692. }
  693. private void FrmBackSlab_Load(object sender, EventArgs e)
  694. {
  695. }
  696. /// <summary>
  697. /// ugbColr的Clear()方法
  698. /// </summary>
  699. private void ugbColClear()
  700. {
  701. txtZPLotNo.Text = "";
  702. txtZPJudgeNo.Text = "";
  703. cmbContrack.Text = "";
  704. cmbRollLength.Text = "";
  705. ckrContrack.Checked = false;
  706. ckrRollLength.Checked = false;
  707. }
  708. }
  709. }