frmSetHopper.cs.svn-base 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using CoreFS.CA06;
  9. using Core.LgMes.Client.lgClassModel;
  10. using Core.Mes.Client.Common;
  11. using System.Collections;
  12. namespace Core.LgMes.Client.LgJobMgt
  13. {
  14. public partial class frmSetHopper : frmStyleBase
  15. {
  16. public OpeBase ob=null;
  17. public frmSetHopper(string szDeviceName)
  18. {
  19. InitializeComponent();
  20. this.devicePos = szDeviceName;
  21. }
  22. #region " Member Variable"
  23. // private string m_szDeviceName = "";
  24. private DataTable m_dtMain = null;
  25. private DataTable m_dtStationconMaterial = null;
  26. private DataTable _dtHopper;
  27. private string sCraftPos = ""; //LG02
  28. private string devicePos = ""; //CVT01
  29. private string _curMaterType = ""; //FL
  30. private PictureBox _curPicBx = null;
  31. private Label _curLbl = null;
  32. #endregion
  33. //选择料斗
  34. private void PicClickHandler(object sender, System.EventArgs e)
  35. {
  36. SetPicNoSelectState();
  37. _curPicBx = (PictureBox)sender;
  38. _curPicBx.BorderStyle = BorderStyle.Fixed3D;
  39. SetLabelColor();
  40. }
  41. private void SetPicNoSelectState()
  42. {
  43. _curPicBx = null;
  44. _curLbl = null;
  45. foreach (Control ctl in panel2.Controls)
  46. {
  47. if (ctl is PictureBox)
  48. ((PictureBox)ctl).BorderStyle = BorderStyle.None;
  49. }
  50. foreach (Control ctl in panel2.Controls)
  51. {
  52. if (ctl is Label)
  53. ((Label)ctl).ForeColor = Color.Black;
  54. }
  55. foreach (Control ctl in panel3.Controls)
  56. {
  57. if (ctl is PictureBox)
  58. ((PictureBox)ctl).BorderStyle = BorderStyle.None;
  59. }
  60. foreach (Control ctl in panel3.Controls)
  61. {
  62. if (ctl is Label)
  63. ((Label)ctl).ForeColor = Color.Black;
  64. }
  65. }
  66. private void SetLabelColor()
  67. {
  68. try
  69. {
  70. if (_curPicBx == null)
  71. {
  72. return;
  73. }
  74. string lbName;
  75. if (Convert.ToInt32(_curPicBx.Name.Substring(10, _curPicBx.Name.Length - 10)) < 21)
  76. {
  77. lbName = "label" + _curPicBx.Tag.ToString();
  78. foreach (Control c in this.panel2.Controls)
  79. {
  80. if (c.Name == lbName)
  81. {
  82. ((Label)c).ForeColor = Color.Red;
  83. return;
  84. }
  85. }
  86. }
  87. else
  88. {
  89. lbName = "label2" + _curPicBx.Tag.ToString();
  90. foreach (Control c in this.panel3.Controls)
  91. {
  92. if (c.Name == lbName)
  93. {
  94. ((Label)c).ForeColor = Color.Red;
  95. return;
  96. }
  97. }
  98. }
  99. }
  100. catch
  101. {
  102. }
  103. }
  104. private void frmSetHopper_Load(object sender, EventArgs e)
  105. {
  106. switch (this.devicePos.Substring(0, 3))
  107. {
  108. case "BOF": // 转炉
  109. this.ultraGroupBox2.Visible = false;
  110. //this.rbWS.Enabled = false; // 喂丝料按钮
  111. this.rbWS.Visible = false;
  112. this.rbFZL.Text = "辅助料";
  113. this.rbHJ.Text = "合金";
  114. this.ultraGroupBox1.Dock = DockStyle.Fill;
  115. break;
  116. case "CAS": // 钢包站
  117. // this.rbFZL.Enabled = false;
  118. this.rbFZL.Visible = true;
  119. this.rbHJ.Text = "合金微调";
  120. break;
  121. case "LFS": // 精炼炉
  122. // this.rbFZL.Enabled = false;
  123. this.rbFZL.Visible = true;
  124. this.rbHJ.Text = "合金微调";
  125. break;
  126. case "RHS": // RH炉
  127. // this.rbFZL.Enabled = false;
  128. this.rbFZL.Visible = true;
  129. this.rbHJ.Text = "合金微调";
  130. break;
  131. case "THJ": // 转炉合金
  132. this.ultraGroupBox2.Visible = false;
  133. this.rbWS.Visible = false; // 喂丝料按钮
  134. this.rbFZL.Enabled = false; // 辅助料
  135. this.ultraGroupBox1.Dock = DockStyle.Fill;
  136. break;
  137. default:
  138. break;
  139. }
  140. //btAdd.Enabled = false;
  141. this.comboBox1.SelectedIndex = 6;
  142. this.ClearLableText();
  143. GetDataSource();
  144. GetStationconMaterialData(this.devicePos.Substring(0, 3));
  145. BindingGrid(this.m_dtStationconMaterial);
  146. }
  147. #region " InitDataSoutce"
  148. private void GetDataSource()
  149. {
  150. string strErr = "";
  151. string strSqlID = "";
  152. try
  153. {
  154. strSqlID = "GetMaterialData.Select";//此ID为XML文件ID
  155. CommonClientToServer cctos=new CommonClientToServer();
  156. cctos.ob = ob;
  157. //查询物料配置信息
  158. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  159. "GetMaterialData", strSqlID, out strErr);
  160. if (strErr == "" && ds != null)
  161. {
  162. this.m_dtMain = ds.Tables[0];
  163. }
  164. }
  165. catch (Exception ex)
  166. {
  167. string Msg = ex.Message;
  168. }
  169. }
  170. /// <summary>
  171. /// 取岗位物料数据
  172. /// </summary>
  173. private void GetStationconMaterialData(string strStrcraftposId)
  174. {
  175. string strErr = "";
  176. string strSqlID = "";
  177. try
  178. {
  179. ArrayList arry = new ArrayList();
  180. arry.Add("GetStationconMaterialData.Select");//此ID为XML文件ID
  181. arry.Add(strStrcraftposId);
  182. CommonClientToServer cctos = new CommonClientToServer();
  183. cctos.ob = ob;
  184. //查询物料配置信息
  185. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  186. "GetStationconMaterialData", arry, out strErr);
  187. if (strErr == "" && ds != null)
  188. {
  189. this.m_dtStationconMaterial = ds.Tables[0];
  190. }
  191. }
  192. catch (Exception ex)
  193. {
  194. string Msg = ex.Message;
  195. }
  196. }
  197. private void BindingGrid(DataTable dt)
  198. {
  199. //this.ulgridMtrInfo.DataSource = dt;
  200. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].Width = 60;
  201. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].Header.Caption = "物料编码";
  202. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  203. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELCODE"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
  204. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].Width = 140;
  205. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].Header.Caption = "物料全称";
  206. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELNAME"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  207. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].Width = 100;
  208. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].Header.Caption = "物料简称";
  209. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELFORSHORT"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  210. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].Width = 65;
  211. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].Header.Caption = "物料类型";
  212. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["WLLXM"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  213. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Width = 0;
  214. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Header.Caption = "";
  215. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
  216. this.ulgridMtrInfo.DisplayLayout.Bands[0].Columns["MATERIELTYPE"].Hidden = true;
  217. }
  218. #endregion
  219. private void ClearLableText()
  220. {
  221. this.lblG1.Text = "";
  222. this.lblG2.Text = "";
  223. this.lblG3.Text = "";
  224. this.lblG4.Text = "";
  225. this.lblG5.Text = "";
  226. this.lblG6.Text = "";
  227. this.lblG7.Text = "";
  228. this.lblG8.Text = "";
  229. this.lblG9.Text = "";
  230. this.lblG10.Text = "";
  231. this.lblG11.Text = "";
  232. this.lblG12.Text = "";
  233. this.lblG13.Text = "";
  234. this.lblG14.Text = "";
  235. this.lblG15.Text = "";
  236. this.lblG16.Text = "";
  237. this.lblG17.Text = "";
  238. this.lblG18.Text = "";
  239. this.lblG19.Text = "";
  240. this.lblG20.Text = "";
  241. this.lblW1.Text = "";
  242. this.lblW2.Text = "";
  243. this.lblW3.Text = "";
  244. this.lblW4.Text = "";
  245. this.lblW5.Text = "";
  246. this.lblW6.Text = "";
  247. this.lblW7.Text = "";
  248. this.lblW8.Text = "";
  249. }
  250. private void GetCurrLabel()
  251. {
  252. try
  253. {
  254. if (_curPicBx == null)
  255. {
  256. this._curLbl = null;
  257. return;
  258. }
  259. string lbName;
  260. if (Convert.ToInt32(_curPicBx.Name.Substring(10, _curPicBx.Name.Length - 10)) < 21)
  261. {
  262. lbName = "lblG" + _curPicBx.Tag.ToString();
  263. foreach (Control c in this.panel2.Controls)
  264. {
  265. if (c.Name == lbName)
  266. {
  267. this._curLbl = (Label)c;
  268. return;
  269. }
  270. }
  271. }
  272. else
  273. {
  274. lbName = "lblW" + _curPicBx.Tag.ToString();
  275. foreach (Control c in this.panel3.Controls)
  276. {
  277. if (c.Name == lbName)
  278. {
  279. this._curLbl = (Label)c;
  280. return;
  281. }
  282. }
  283. }
  284. }
  285. catch
  286. {
  287. this._curLbl = null;
  288. }
  289. }
  290. private void btClose_Click(object sender, EventArgs e)
  291. {
  292. this.Close();
  293. }
  294. /// <summary>
  295. /// 添料
  296. /// </summary>
  297. /// <param name="sender"></param>
  298. /// <param name="e"></param>
  299. private void btAdd_Click(object sender, EventArgs e)
  300. {
  301. string strErr = "";
  302. string szWLLX = "";
  303. Infragistics.Win.UltraWinGrid.UltraGridRow urg = this.ulgridMtrInfo.ActiveRow;
  304. if (urg == null)
  305. {
  306. MessageBox.Show("请选择物料!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  307. return;
  308. }
  309. if (_curPicBx == null)
  310. {
  311. MessageBox.Show("请选择料斗!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  312. return;
  313. }
  314. GetCurrLabel();
  315. if (_curLbl.Tag != null)
  316. szWLLX = _curLbl.Tag.ToString();
  317. string materialName = Convert.ToString(urg.Cells["MATERIELNAME"].Value);
  318. string strSqlID = "SwapHopper.Procedure";
  319. Hashtable hashtb = new Hashtable();
  320. hashtb.Add("I1", _curPicBx.Tag.ToString()); //料仓编号
  321. hashtb.Add("I2", this.devicePos); //料仓置位
  322. hashtb.Add("I3", urg.Cells["MATERIELTYPE"].Value.ToString()); //物料类型
  323. hashtb.Add("I4", Convert.ToString(urg.Cells["MATERIELCODE"].Value)); //物料编码
  324. hashtb.Add("I5", comboBox1.SelectedItem.ToString()); //物料单位
  325. hashtb.Add("I6", "1"); // 1 为料仓自动投料 2 为手投料
  326. hashtb.Add("I7", "0"); //清空标志 1 为清空 0 为添料
  327. hashtb.Add("I8", szWLLX); //物料类型
  328. CommonClientToServer cctos = new CommonClientToServer();
  329. cctos.ob = ob;
  330. string strCode= cctos.ExecuteProcedureFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  331. "SwapHopper", strSqlID, hashtb, out strErr);
  332. if (strErr.Trim().Length > 0)
  333. {
  334. MessageBox.Show("添料失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  335. return;
  336. }
  337. else
  338. {
  339. this._curLbl.Text = materialName;
  340. _curLbl.Tag = urg.Cells["MATERIELTYPE"].Value.ToString();
  341. }
  342. }
  343. private void btReset_Click(object sender, EventArgs e)
  344. {
  345. string strErr = "";
  346. if (this._curPicBx == null)
  347. {
  348. MessageBox.Show("请选择料斗!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  349. return;
  350. }
  351. GetCurrLabel();
  352. if (this._curLbl.Text.Equals(string.Empty))
  353. return;
  354. DialogResult dia = MessageBox.Show("是否确认重置当前选中的料斗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  355. if (dia == DialogResult.No) return;
  356. string szWLLX = _curLbl.Tag.ToString();
  357. string strSqlID = "SwapHopper.Procedure";
  358. Hashtable hashtb = new Hashtable();
  359. hashtb.Add("I1", _curPicBx.Tag.ToString()); //料仓编号
  360. hashtb.Add("I2", this.devicePos); //料仓置位
  361. hashtb.Add("I3", _curLbl.Tag.ToString()); //物料类型
  362. hashtb.Add("I4", ""); //物料编码
  363. hashtb.Add("I5", ""); //物料单位
  364. hashtb.Add("I6", "1"); // 1 为料仓自动投料 2 为手投料
  365. hashtb.Add("I7", "1"); //清空标志 1 为清空 0 为添料
  366. hashtb.Add("I8", szWLLX); //物料类型
  367. CommonClientToServer cctos = new CommonClientToServer();
  368. cctos.ob = ob;
  369. string strCode = cctos.ExecuteProcedureFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  370. "SwapHopper", strSqlID, hashtb, out strErr);
  371. if (strErr.Trim().Length > 0)
  372. {
  373. MessageBox.Show("重置失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  374. return;
  375. }
  376. this._curLbl.Text = "";
  377. }
  378. private void SetPicText(bool IsJS, string hopperNo, string str, string szWLLX)
  379. {
  380. if (!IsJS)
  381. {
  382. switch (hopperNo)
  383. {
  384. case "1":
  385. this.lblG1.Text = str;
  386. this.lblG1.Tag = szWLLX;
  387. break;
  388. case "2":
  389. this.lblG2.Text = str;
  390. this.lblG2.Tag = szWLLX;
  391. break;
  392. case "3":
  393. this.lblG3.Text = str;
  394. this.lblG3.Tag = szWLLX;
  395. break;
  396. case "4":
  397. this.lblG4.Text = str;
  398. this.lblG4.Tag = szWLLX;
  399. break;
  400. case "5":
  401. this.lblG5.Text = str;
  402. this.lblG5.Tag = szWLLX;
  403. break;
  404. case "6":
  405. this.lblG6.Text = str;
  406. this.lblG6.Tag = szWLLX;
  407. break;
  408. case "7":
  409. this.lblG7.Text = str;
  410. this.lblG7.Tag = szWLLX;
  411. break;
  412. case "8":
  413. this.lblG8.Text = str;
  414. this.lblG8.Tag = szWLLX;
  415. break;
  416. case "9":
  417. this.lblG9.Text = str;
  418. this.lblG9.Tag = szWLLX;
  419. break;
  420. case "10":
  421. this.lblG10.Text = str;
  422. this.lblG10.Tag = szWLLX;
  423. break;
  424. case "11":
  425. this.lblG11.Text = str;
  426. this.lblG11.Tag = szWLLX;
  427. break;
  428. case "12":
  429. this.lblG12.Text = str;
  430. this.lblG12.Tag = szWLLX;
  431. break;
  432. case "13":
  433. this.lblG13.Text = str;
  434. this.lblG13.Tag = szWLLX;
  435. break;
  436. case "14":
  437. this.lblG14.Text = str;
  438. this.lblG14.Tag = szWLLX;
  439. break;
  440. case "15":
  441. this.lblG15.Text = str;
  442. this.lblG15.Tag = szWLLX;
  443. break;
  444. case "16":
  445. this.lblG16.Text = str;
  446. this.lblG16.Tag = szWLLX;
  447. break;
  448. case "17":
  449. this.lblG17.Text = str;
  450. this.lblG17.Tag = szWLLX;
  451. break;
  452. case "18":
  453. this.lblG18.Text = str;
  454. this.lblG18.Tag = szWLLX;
  455. break;
  456. case "19":
  457. this.lblG19.Text = str;
  458. this.lblG19.Tag = szWLLX;
  459. break;
  460. case "20":
  461. this.lblG20.Text = str;
  462. this.lblG20.Tag = szWLLX;
  463. break;
  464. case "21":
  465. this.lblG20.Text = str;
  466. this.lblG20.Tag = szWLLX;
  467. break;
  468. case "22":
  469. this.lblG20.Text = str;
  470. this.lblG20.Tag = szWLLX;
  471. break;
  472. case "23":
  473. this.lblG20.Text = str;
  474. this.lblG20.Tag = szWLLX;
  475. break;
  476. case "24":
  477. this.lblG20.Text = str;
  478. this.lblG20.Tag = szWLLX;
  479. break;
  480. default:
  481. break;
  482. }
  483. }
  484. else
  485. {
  486. if (hopperNo == "1")
  487. {
  488. this.lblW1.Text = str;
  489. this.lblW1.Tag = szWLLX;
  490. }
  491. if (hopperNo == "2")
  492. {
  493. this.lblW2.Text = str;
  494. this.lblW2.Tag = szWLLX;
  495. }
  496. if (hopperNo == "3")
  497. {
  498. this.lblW3.Text = str;
  499. this.lblW3.Tag = szWLLX;
  500. }
  501. if (hopperNo == "4")
  502. {
  503. this.lblW4.Text = str;
  504. this.lblW4.Tag = szWLLX;
  505. }
  506. if (hopperNo == "5")
  507. {
  508. this.lblW5.Text = str;
  509. this.lblW5.Tag = szWLLX;
  510. }
  511. if (hopperNo == "6")
  512. {
  513. this.lblW6.Text = str;
  514. this.lblW6.Tag = szWLLX;
  515. }
  516. if (hopperNo == "7")
  517. {
  518. this.lblW7.Text = str;
  519. this.lblW7.Tag = szWLLX;
  520. }
  521. if (hopperNo == "8")
  522. {
  523. this.lblW8.Text = str;
  524. this.lblW8.Tag = szWLLX;
  525. }
  526. }
  527. }
  528. private void GetDataForHopper()
  529. {
  530. string strErr = "";
  531. string strSqlId = "";
  532. ArrayList arry = new ArrayList();
  533. //处理转炉与WS数据
  534. if ((devicePos.Substring(0, 3) != "CAS" && devicePos.Substring(0, 3) != "LFS" && devicePos.Substring(0, 3) != "RHS"
  535. && devicePos.Substring(0, 3) != "VDS") || _curMaterType == "WS")
  536. {
  537. strSqlId = "GetHopperNameBof.Select";
  538. arry.Add(strSqlId);//此ID为XML文件ID
  539. arry.Add(devicePos);
  540. arry.Add(_curMaterType);
  541. }
  542. else
  543. {
  544. strSqlId = "GetHopperNameSet.Select";
  545. arry.Add(strSqlId);//此ID为XML文件ID
  546. arry.Add(devicePos);
  547. }
  548. CommonClientToServer cctos = new CommonClientToServer();
  549. cctos.ob = ob;
  550. //查询料斗物料配置信息
  551. DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassCommonModule",
  552. "GetHopperName", arry, out strErr);
  553. if (strErr=="" && ds != null )
  554. {
  555. _dtHopper = ds.Tables[0];
  556. DataRow[] drs = null;
  557. bool bFlag = false;
  558. for (int i = 0; i < _dtHopper.Rows.Count; i++)
  559. {
  560. try
  561. {
  562. DataRow dr = _dtHopper.Rows[i];
  563. string id = dr["MSNUMID"].ToString();
  564. drs = _dtHopper.Select(" MSNUMID = '" + id + "'"); //and MATERIELTYPE='" + _curMaterType + "'"
  565. if (drs.Length > 0)
  566. {
  567. for (int j = 0; j < drs.Length; j++)
  568. {
  569. if (drs[j]["MATERIELCODE"].ToString() != "")
  570. {
  571. SetPicText((_curMaterType == "WS"), drs[j]["MSNUMID"].ToString(), drs[j]["MATERIELFORSHORT"].ToString(), drs[j]["MATERIELTYPE"].ToString());
  572. bFlag = true;
  573. break;
  574. }
  575. }
  576. }
  577. if (false == bFlag)
  578. SetPicText((_curMaterType == "WS"), dr["MSNUMID"].ToString(), dr["MATERIELFORSHORT"].ToString(), dr["MATERIELTYPE"].ToString());
  579. if (bFlag)
  580. bFlag = false;
  581. }
  582. catch { }
  583. }
  584. }
  585. }
  586. //显示料斗配置信息
  587. private void radioButton_Click(object sender, System.EventArgs e)
  588. {
  589. this.btAdd.Enabled = true;
  590. if (_curMaterType != ((RadioButton)sender).Tag.ToString())
  591. _curMaterType = ((RadioButton)sender).Tag.ToString();
  592. else
  593. return;
  594. if (_curMaterType != "WS")
  595. {
  596. // this.ultraGroupBox4.Visible = false;
  597. // this.rbWS.Enabled=false; // 喂丝料按钮
  598. // this.ultraGroupBox3.Dock = DockStyle.Fill;
  599. panel2.Enabled = true;
  600. panel3.Enabled = false;
  601. }
  602. else // 物料类型为喂丝
  603. {
  604. // this.ultraGroupBox3.Visible = false;
  605. // this.rbWS.Enabled = true; // 喂丝料按钮
  606. // this.rbFZL.Enabled = false;
  607. // this.rbHJ.Enabled = false;
  608. // this.ultraGroupBox4.Dock = DockStyle.Fill;
  609. panel2.Enabled = false;
  610. panel3.Enabled = true;
  611. }
  612. ClearLableText();
  613. SetPicNoSelectState();
  614. GetDataForHopper();
  615. if (chkdevNo.Checked)
  616. {
  617. if (this.m_dtStationconMaterial.Rows.Count > 0)
  618. {
  619. this.m_dtStationconMaterial.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  620. ulgridMtrInfo.DataSource = this.m_dtStationconMaterial;
  621. }
  622. }
  623. else
  624. {
  625. this.m_dtMain.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  626. ulgridMtrInfo.DataSource = this.m_dtMain;
  627. }
  628. this.ulgridMtrInfo.UpdateData();
  629. }
  630. private void chkdevNo_CheckedChanged(object sender, EventArgs e)
  631. {
  632. try
  633. {
  634. if (chkdevNo.Checked)
  635. {
  636. this.m_dtStationconMaterial.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  637. ulgridMtrInfo.DataSource = this.m_dtStationconMaterial;
  638. }
  639. else
  640. {
  641. this.m_dtMain.DefaultView.RowFilter = "MATERIELTYPE='" + _curMaterType + "'";
  642. ulgridMtrInfo.DataSource = this.m_dtMain;
  643. }
  644. this.ulgridMtrInfo.UpdateData();
  645. }
  646. catch
  647. {
  648. }
  649. }
  650. }
  651. }