FrmStuffInputStore.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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.Tool;
  11. using System.Collections;
  12. using Core.StlMes.Client.YdmStuffManage.Entity;
  13. using Infragistics.Win.UltraWinGrid;
  14. using Core.Mes.Client.Comm.Format;
  15. using Core.Mes.Client.Comm.Server;
  16. using Infragistics.Win;
  17. namespace Core.StlMes.Client.YdmStuffManage
  18. {
  19. public partial class FrmStuffInputStore : FrmBase
  20. {
  21. public FrmStuffInputStore()
  22. {
  23. InitializeComponent();
  24. }
  25. string strInBound = "800701";
  26. private string[] arr = null;
  27. private void FrmStuffInputStore_Load(object sender, EventArgs e)
  28. {
  29. DateTime now = DateTime.Now;
  30. DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
  31. DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
  32. this.StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
  33. this.EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
  34. BaseMethod.InitCellPosition(entityGrid2, new string[] { "ActWeight", "ActCount","ActLen", "FixNum", "FixLen", "Dimater" });
  35. arr = BaseMethod.InitLgPermissions(this.ValidDataPurviewIds,"B", this.ob);
  36. //BaseMethod.InitCellPosition(entityGrid3, new string[] { "ActWeight", "ActCount", "ActLenMax", "ActLenMin", "actLen", "actFixNum", "actFixLen", "ActDimater" });
  37. }
  38. /// <summary>
  39. /// 重写基类方法
  40. /// </summary>
  41. /// <param name="sender"></param>
  42. /// <param name="ToolbarKey"></param>
  43. public override void ToolBar_Click(object sender, string ToolbarKey)
  44. {
  45. switch (ToolbarKey)
  46. {
  47. case "Query":
  48. doQueryPlan();
  49. break;
  50. case"QueryInList":
  51. doQueryInList();
  52. break;
  53. case "Receive":
  54. //ReceiveData();
  55. break;
  56. case "CancelReceive":
  57. //CancelReceive();
  58. break;
  59. case"EnsureInPut":
  60. EnsureInPutData();
  61. break;
  62. case"CancelInPut":
  63. CancelInPutData();
  64. break;
  65. case"WasteCount":
  66. wasteCount();
  67. break;
  68. case"DoBeside":
  69. doBeside();
  70. break;
  71. case "CancelDoBeside":
  72. cancelDoBeside();
  73. break;
  74. case "Close":
  75. this.Close();
  76. break;
  77. }
  78. }
  79. /// <summary>
  80. /// 结炉
  81. /// </summary>
  82. private void doBeside()
  83. {
  84. this.entityGrid1.UpdateData();
  85. UltraGridRow uRow = this.entityGrid1.ActiveRow;
  86. if (uRow == null)
  87. {
  88. return;
  89. }
  90. if (!uRow.Cells["CcmState"].Text.Equals("表检完成"))
  91. {
  92. MessageUtil.ShowTips("表检未完成,不允许结炉!");
  93. return;
  94. }
  95. ArrayList parm = new ArrayList();
  96. parm.Add(uRow.Cells["Furnaceno"].Text);
  97. parm.Add(uRow.Cells["Sequenceno"].Text);
  98. parm.Add(uRow.Cells["StoveNo"].Text);
  99. parm.Add(uRow.Cells["JudgeStoveNoSeq"].Text);
  100. DataTable ds = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.doQueryRecive", new object[] { parm }, ob);
  101. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  102. {
  103. MessageUtil.ShowTips("还有未入库的管坯,不允许结炉!");
  104. return;
  105. }
  106. PlnSteelforOrdEntity plnOrdEntity = (PlnSteelforOrdEntity)uRow.ListObject;
  107. string plnOrdTity = JSONFormat.Format(plnOrdEntity);
  108. CoreClientParam ccp = new CoreClientParam();
  109. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore";
  110. ccp.MethodName = "doBeside";
  111. ccp.ServerParams = new object[] { plnOrdTity };
  112. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  113. if (ccp.ReturnCode != -1)
  114. {
  115. if (ccp.ReturnInfo.Equals("结炉成功!"))
  116. {
  117. doQueryPlan();
  118. MessageUtil.ShowTips(ccp.ReturnInfo);
  119. }
  120. else
  121. {
  122. MessageUtil.ShowTips(ccp.ReturnInfo);
  123. }
  124. }
  125. //ServerHelper.SetData("Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.doBeside", new object[] { plnOrdTity }, ob);
  126. //doQueryPlan();
  127. //MessageUtil.ShowTips("结炉成功!");
  128. }
  129. /// <summary>
  130. /// 结炉回退
  131. /// </summary>
  132. private void cancelDoBeside()
  133. {
  134. this.entityGrid1.UpdateData();
  135. UltraGridRow uRow = this.entityGrid1.ActiveRow;
  136. if (uRow == null)
  137. {
  138. return;
  139. }
  140. if (!uRow.Cells["CcmState"].Text.Equals("入库完成"))
  141. {
  142. MessageUtil.ShowTips("入库未完成,不允许结炉回退!");
  143. return;
  144. }
  145. ArrayList parm = new ArrayList();
  146. parm.Add(uRow.Cells["Furnaceno"].Text);
  147. parm.Add(uRow.Cells["Sequenceno"].Text);
  148. parm.Add(uRow.Cells["StoveNo"].Text);
  149. parm.Add(uRow.Cells["JudgeStoveNo"].Text);
  150. DataTable ds = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.doQueryMatJudgeApp", new object[] { parm }, ob);
  151. if (int.Parse(ds.Rows[0][0].ToString()) > 0)
  152. {
  153. MessageUtil.ShowTips("该炉已申请判定,不允许结炉回退!");
  154. return;
  155. }
  156. PlnSteelforOrdEntity plnOrdEntity = (PlnSteelforOrdEntity)uRow.ListObject;
  157. string plnOrdTity = JSONFormat.Format(plnOrdEntity);
  158. CoreClientParam ccp = new CoreClientParam();
  159. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore";
  160. ccp.MethodName = "cancelDoBeside";
  161. ccp.ServerParams = new object[] { plnOrdTity };
  162. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  163. if (ccp.ReturnCode != -1)
  164. {
  165. if (ccp.ReturnInfo.Equals("结炉回退成功!"))
  166. {
  167. doQueryPlan();
  168. MessageUtil.ShowTips(ccp.ReturnInfo);
  169. }
  170. else
  171. {
  172. MessageUtil.ShowTips(ccp.ReturnInfo);
  173. }
  174. }
  175. }
  176. /// <summary>
  177. /// 交库前剔废
  178. /// </summary>
  179. private void wasteCount()
  180. {
  181. UltraGridRow uRow = this.entityGrid1.ActiveRow;
  182. if (uRow == null) return;
  183. //if (uRow.HasChild())
  184. //{
  185. // return;
  186. //}
  187. ArrayList parmList = new ArrayList();
  188. parmList.Add(uRow.Cells["Furnaceno"].Text);
  189. parmList.Add(uRow.Cells["Sequenceno"].Text);
  190. parmList.Add(uRow.Cells["StoveNo"].Text);
  191. parmList.Add(uRow.Cells["JudgeStoveNoSeq"].Text);
  192. DataTable ds = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.FrmStuffSurfaceResult.doQueryPlnSteeOrd", new object[] { parmList }, ob);
  193. if (!ds.Rows[0]["CCM_STATE"].ToString().Equals("20"))
  194. {
  195. MessageUtil.ShowTips("执行状态不是表检完成,不允许进行下线点剔废!");
  196. return;
  197. }
  198. WasteFrom waste = new WasteFrom(parmList,ob);
  199. waste.ShowDialog();
  200. doQueryPlan();
  201. }
  202. /// <summary>
  203. /// 查询炉计划
  204. /// </summary>
  205. private void doQueryPlan()
  206. {
  207. string[] L1 = new string[] { "Furnaceno" };
  208. string[] L2 = new string[] { "Furnaceno" };
  209. string startTim = "";
  210. string endTim = "";
  211. string stoveNo = "";
  212. if (this.chkTim.Checked)
  213. {
  214. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  215. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  216. }
  217. if (!CheckQuery())
  218. {
  219. return;
  220. }
  221. if (this.chkStoveNo.Checked && this.txtStoveNo.Text.Trim() != "")
  222. {
  223. stoveNo = this.txtStoveNo.Text.Trim();
  224. }
  225. // List<PlnSteelforOrdEntity1> listSource = EntityHelper.GetData<PlnSteelforOrdEntity1>(
  226. //"Core.LgMes.Server.Stuffmanage.FrmStuffSurfaceResult.doQueryPlanStoveNo", new object[] { startTim, endTim, stoveNo, this.ultraOptionSet2.CheckedItem.DataValue.ToString(), arr, "1" }, this.ob);
  227. stlLgProgrrssEntityBindingSource.Clear();
  228. List<PlnSteelforOrdEntity> listSource1 = EntityHelper.GetData<PlnSteelforOrdEntity>(
  229. "Core.LgMes.Server.Stuffmanage.FrmStuffSurfaceResult.doQueryPlan", new object[] { startTim, endTim, stoveNo, this.ultraOptionSet2.CheckedItem.DataValue.ToString(), arr,"1" }, this.ob);
  230. //EntityHelper.AddEntityRelation(listSource, listSource1, L1, L2);
  231. PlnSteelforOrdEntityBindingSource.DataSource = listSource1;
  232. this.entityGrid1.DisplayLayout.Bands[0].Columns["StoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  233. }
  234. /// <summary>
  235. /// 合并单元格
  236. /// </summary>
  237. /// <param name="ug"></param>
  238. /// <param name="columnKeys"></param>
  239. private void MergedCell(UltraGrid ug, string[] columnKeys)
  240. {
  241. if (columnKeys.Length == 0)
  242. {
  243. return;
  244. }
  245. ug.DisplayLayout.Override.MergedCellStyle = MergedCellStyle.Never;
  246. for (int i = 0; i < columnKeys.Length; i++)
  247. {
  248. ug.DisplayLayout.Bands[0].Columns[columnKeys[i]].MergedCellStyle = MergedCellStyle.Always;
  249. }
  250. }
  251. /// <summary>
  252. /// 数据验证
  253. /// </summary>
  254. /// <returns></returns>
  255. private bool CheckQuery()
  256. {
  257. if (this.chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text.Trim()))
  258. {
  259. MessageUtil.ShowWarning("请输入熔炼炉号!");
  260. return false;
  261. }
  262. //if(this.chkJugeHeatNo.Checked&& string.IsNullOrEmpty(this.txtJugeNo.Text.Trim()))
  263. //{
  264. // MessageUtil.ShowWarning("请输入判定炉号!");
  265. // return false;
  266. //}
  267. return true;
  268. }
  269. /// <summary>
  270. /// 查询入库实绩
  271. /// </summary>
  272. private void doQueryInList()
  273. {
  274. string heatNo = "";
  275. string startTim = "";
  276. string endTim = "";
  277. string[] arr = BaseMethod.InitLgPermissions(this.ValidDataPurviewIds,"B", this.ob);
  278. if (!CheckQuery()) return;
  279. if (this.chkStoveNo.Checked)
  280. {
  281. heatNo = this.txtStoveNo.Text.Trim();
  282. }
  283. if (this.chkTim.Checked)
  284. {
  285. startTim = this.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  286. endTim = this.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  287. }
  288. //if (this.chkJugeHeatNo.Checked)
  289. //{
  290. // judgeHeatNo = this.txtJugeNo.Text.Trim();
  291. //}
  292. List<YdmGpInlistEntity> listSource = EntityHelper.GetData<YdmGpInlistEntity>(
  293. "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.doQueryInList", new object[] { startTim, endTim, heatNo, arr }, this.ob);
  294. YdmGpInlistEntitybindingSource.DataSource = listSource;
  295. }
  296. /// <summary>
  297. /// 收料
  298. /// </summary>
  299. private void ReceiveData()
  300. {
  301. this.entityGrid1.UpdateData();
  302. string storeNo = "";
  303. IQueryable<UltraGridRow> checkMagRows = this.entityGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
  304. if (checkMagRows.Count() == 0)
  305. {
  306. MessageUtil.ShowTips("请勾选需要收料的切割实绩信息!");
  307. return;
  308. }
  309. string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo,this.ValidDataPurviewIds,ob);
  310. if (arr[0].ToString() == "")
  311. {
  312. MessageUtil.ShowTips("无仓库权限,无法收料!");
  313. return;
  314. }
  315. storeNo = arr[0].ToString();
  316. ArrayList parm = new ArrayList();
  317. foreach (UltraGridRow uRow in checkMagRows)
  318. {
  319. StlIncisionEntity stlInEntity = (StlIncisionEntity)uRow.ListObject;
  320. string stlIntity = JSONFormat.Format(stlInEntity);
  321. parm.Add(stlIntity);
  322. }
  323. if (MessageUtil.ShowYesNoAndQuestion("是否收料?") == DialogResult.No)
  324. {
  325. return;
  326. }
  327. CoreClientParam ccp = new CoreClientParam();
  328. ccp.ServerName = "com.steering.pss.ydm.Stuffmanage.FrmStuffInputStore";
  329. ccp.MethodName = "receiveData";
  330. ccp.ServerParams = new object[] { parm,this.UserInfo.GetUserName() };
  331. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  332. if (ccp.ReturnCode != -1)
  333. {
  334. if (ccp.ReturnInfo.Equals("收料成功!"))
  335. {
  336. MessageUtil.ShowTips(ccp.ReturnInfo);
  337. }
  338. else
  339. {
  340. MessageUtil.ShowTips(ccp.ReturnInfo);
  341. }
  342. }
  343. }
  344. /// <summary>
  345. /// 撤销收料
  346. /// </summary>
  347. private void CancelReceive()
  348. {
  349. this.entityGrid2.UpdateData();
  350. IQueryable<UltraGridRow> checkMagRows = this.entityGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  351. if (checkMagRows.Count() == 0)
  352. {
  353. MessageUtil.ShowTips("请勾选需要撤销的收料实绩!");
  354. return;
  355. }
  356. ArrayList parm = new ArrayList();
  357. foreach (UltraGridRow uRow in checkMagRows)
  358. {
  359. MatGpMEntity matGpEntity = (MatGpMEntity)uRow.ListObject;
  360. string matTity = JSONFormat.Format(matGpEntity);
  361. parm.Add(matTity);
  362. }
  363. if (MessageUtil.ShowYesNoAndQuestion("是否撤销收料?") == DialogResult.No)
  364. {
  365. return;
  366. }
  367. CoreClientParam ccp = new CoreClientParam();
  368. ccp.ServerName = "com.steering.pss.ydm.Stuffmanage.FrmStuffInputStore";
  369. ccp.MethodName = "cancelReceive";
  370. ccp.ServerParams = new object[] { parm};
  371. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  372. if (ccp.ReturnCode != -1)
  373. {
  374. if (ccp.ReturnInfo.Equals("撤销收料成功!"))
  375. {
  376. doQueryPlan();
  377. MessageUtil.ShowTips(ccp.ReturnInfo);
  378. }
  379. else
  380. {
  381. MessageUtil.ShowTips(ccp.ReturnInfo);
  382. }
  383. }
  384. }
  385. /// <summary>
  386. /// 确认入库
  387. /// </summary>
  388. private void EnsureInPutData()
  389. {
  390. this.entityGrid2.UpdateData();
  391. UltraGridRow uRow1 = this.entityGrid1.ActiveRow;
  392. if (uRow1 == null)
  393. {
  394. return;
  395. }
  396. if (uRow1.Cells["CcmState"].Text != "表检完成")
  397. {
  398. MessageUtil.ShowTips("表检未完成,不允许交库!");
  399. return;
  400. }
  401. string storeNo = "";
  402. string departId = ClsLoad.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob);
  403. string departMent = ClsLoad.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob);
  404. string[] storeType = new string[4];
  405. IQueryable<UltraGridRow> checkMagRows = this.entityGrid2.Rows.AsQueryable().Where(" CHK = 'True'");
  406. if (checkMagRows.Count() == 0)
  407. {
  408. MessageUtil.ShowTips("请勾选可交库信息!");
  409. return;
  410. }
  411. //string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo, this.ValidDataPurviewIds, ob);
  412. //if (arr[0].ToString() == "")
  413. //{
  414. // MessageUtil.ShowTips("无仓库权限,无法入库!");
  415. // return;
  416. //}
  417. //storeNo = arr[0].ToString();
  418. if (uRow1.Cells["PlineCode"].Text.Equals("C002"))
  419. {
  420. storeNo = "XYL1";
  421. }
  422. else if (uRow1.Cells["PlineCode"].Text.Equals("C004"))
  423. {
  424. storeNo = "XEL1";
  425. }
  426. else if (uRow1.Cells["PlineCode"].Text.Equals("C007"))
  427. {
  428. storeNo = "XSL1";
  429. }
  430. else
  431. {
  432. MessageUtil.ShowTips("未获取到所在产线,无法交库!");
  433. return;
  434. }
  435. storeType = getStoreType(storeNo);
  436. ArrayList parm = new ArrayList();
  437. foreach (UltraGridRow uRow in checkMagRows)
  438. {
  439. StlLgProgrrssEntity matGpEntity = (StlLgProgrrssEntity)uRow.ListObject;
  440. string matTity = JSONFormat.Format(matGpEntity);
  441. parm.Add(matTity);
  442. }
  443. PlnSteelforOrdEntity plnSteelForTity = (PlnSteelforOrdEntity)uRow1.ListObject;
  444. string plnSteelEntity = JSONFormat.Format(plnSteelForTity);
  445. if (MessageUtil.ShowYesNoAndQuestion("是否入库?") == DialogResult.No)
  446. {
  447. return;
  448. }
  449. CoreClientParam ccp = new CoreClientParam();
  450. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore";
  451. ccp.MethodName = "ensureInPutData";
  452. ccp.ServerParams = new object[] { parm, storeNo, strInBound, storeType, this.UserInfo.GetUserName(), this.UserInfo.GetDeptid(), this.UserInfo.GetDepartment(), departId, departMent, plnSteelEntity };
  453. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  454. if (ccp.ReturnCode != -1)
  455. {
  456. if (ccp.ReturnInfo.Equals("入库成功!"))
  457. {
  458. doQueryPlan();
  459. MessageUtil.ShowTips(ccp.ReturnInfo);
  460. }
  461. else
  462. {
  463. MessageUtil.ShowTips(ccp.ReturnInfo);
  464. }
  465. }
  466. }
  467. /// <summary>
  468. /// 撤销入库
  469. /// </summary>
  470. private void CancelInPutData()
  471. {
  472. this.entityGrid3.UpdateData();
  473. IQueryable<UltraGridRow> checkMagRows = this.entityGrid3.Rows.AsQueryable().Where(" CHK = 'True'");
  474. if (checkMagRows.Count() == 0)
  475. {
  476. MessageUtil.ShowTips("请勾选需要撤销的入库实绩!");
  477. return;
  478. }
  479. ArrayList parm = new ArrayList();
  480. foreach (UltraGridRow uRow in checkMagRows)
  481. {
  482. YdmGpInlistEntity ydmGpInListEntity = (YdmGpInlistEntity)uRow.ListObject;
  483. string inListTity = JSONFormat.Format(ydmGpInListEntity);
  484. parm.Add(inListTity);
  485. }
  486. if (MessageUtil.ShowYesNoAndQuestion("是否撤销入库?") == DialogResult.No)
  487. {
  488. return;
  489. }
  490. CoreClientParam ccp = new CoreClientParam();
  491. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore";
  492. ccp.MethodName = "cancelInPutData";
  493. ccp.ServerParams = new object[] { parm };
  494. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  495. if (ccp.ReturnCode != -1)
  496. {
  497. if (ccp.ReturnInfo.Equals("撤销入库成功!"))
  498. {
  499. doQueryInList();
  500. MessageUtil.ShowTips(ccp.ReturnInfo);
  501. }
  502. else
  503. {
  504. MessageUtil.ShowTips(ccp.ReturnInfo);
  505. }
  506. }
  507. }
  508. /// <summary>
  509. /// 查询仓库类型
  510. /// </summary>
  511. /// <param name="storeNo"></param>
  512. /// <returns></returns>
  513. private string[] getStoreType(string storeNo)
  514. {
  515. string[] storeType = new string[4];
  516. DataTable dt = ServerHelper.GetData("Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.getStoreType", new object[] { storeNo }, ob);
  517. if (dt.Rows.Count > 0)
  518. {
  519. storeType[0] = dt.Rows[0]["STORAGE_ATTR"].ToString();
  520. storeType[1] = dt.Rows[0]["STORAGE_ATTR_NAME"].ToString();
  521. storeType[2] = dt.Rows[0]["STORAGE_TYPE_NO"].ToString();
  522. storeType[3] = dt.Rows[0]["STORAGE_TYPE_NAME"].ToString();
  523. }
  524. return storeType;
  525. }
  526. private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e)
  527. {
  528. if (ultraTabControl1.SelectedTab.Key == "0")
  529. {
  530. if (toolMenu == null) return;
  531. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  532. {
  533. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  534. }
  535. if (toolMenu.Toolbars[0].Tools.Exists("QueryInList"))
  536. {
  537. toolMenu.Toolbars[0].Tools["QueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  538. }
  539. if (toolMenu.Toolbars[0].Tools.Exists("WasteCount"))
  540. {
  541. toolMenu.Toolbars[0].Tools["WasteCount"].InstanceProps.Visible = DefaultableBoolean.True;
  542. }
  543. if (toolMenu.Toolbars[0].Tools.Exists("EnsureInPut"))
  544. {
  545. toolMenu.Toolbars[0].Tools["EnsureInPut"].InstanceProps.Visible = DefaultableBoolean.True;
  546. }
  547. if (toolMenu.Toolbars[0].Tools.Exists("CancelInPut"))
  548. {
  549. toolMenu.Toolbars[0].Tools["CancelInPut"].InstanceProps.Visible = DefaultableBoolean.False;
  550. }
  551. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  552. {
  553. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  554. }
  555. if (toolMenu.Toolbars[0].Tools.Exists("CancelDoBeside"))
  556. {
  557. toolMenu.Toolbars[0].Tools["CancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  558. }
  559. this.ultraOptionSet2.Visible = true;
  560. this.chkTim.Text = "计划日期";
  561. }
  562. if (ultraTabControl1.SelectedTab.Key == "1")
  563. {
  564. if (toolMenu == null) return;
  565. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  566. {
  567. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.False;
  568. }
  569. if (toolMenu.Toolbars[0].Tools.Exists("QueryInList"))
  570. {
  571. toolMenu.Toolbars[0].Tools["QueryInList"].InstanceProps.Visible = DefaultableBoolean.True;
  572. }
  573. if (toolMenu.Toolbars[0].Tools.Exists("WasteCount"))
  574. {
  575. toolMenu.Toolbars[0].Tools["WasteCount"].InstanceProps.Visible = DefaultableBoolean.False;
  576. }
  577. if (toolMenu.Toolbars[0].Tools.Exists("EnsureInPut"))
  578. {
  579. toolMenu.Toolbars[0].Tools["EnsureInPut"].InstanceProps.Visible = DefaultableBoolean.False;
  580. }
  581. if (toolMenu.Toolbars[0].Tools.Exists("CancelInPut"))
  582. {
  583. toolMenu.Toolbars[0].Tools["CancelInPut"].InstanceProps.Visible = DefaultableBoolean.True;
  584. }
  585. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  586. {
  587. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  588. }
  589. if (toolMenu.Toolbars[0].Tools.Exists("CancelDoBeside"))
  590. {
  591. toolMenu.Toolbars[0].Tools["CancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.False;
  592. }
  593. this.ultraOptionSet2.Visible = false;
  594. this.chkTim.Text = "入库时间";
  595. }
  596. else
  597. {
  598. }
  599. }
  600. private void FrmStuffInputStore_Shown(object sender, EventArgs e)
  601. {
  602. if (toolMenu == null) return;
  603. if (toolMenu.Toolbars[0].Tools.Exists("Query"))
  604. {
  605. toolMenu.Toolbars[0].Tools["Query"].InstanceProps.Visible = DefaultableBoolean.True;
  606. }
  607. if (toolMenu.Toolbars[0].Tools.Exists("QueryInList"))
  608. {
  609. toolMenu.Toolbars[0].Tools["QueryInList"].InstanceProps.Visible = DefaultableBoolean.False;
  610. }
  611. if (toolMenu.Toolbars[0].Tools.Exists("EnsureInPut"))
  612. {
  613. toolMenu.Toolbars[0].Tools["EnsureInPut"].InstanceProps.Visible = DefaultableBoolean.True;
  614. }
  615. if (toolMenu.Toolbars[0].Tools.Exists("WasteCount"))
  616. {
  617. toolMenu.Toolbars[0].Tools["WasteCount"].InstanceProps.Visible = DefaultableBoolean.True;
  618. }
  619. if (toolMenu.Toolbars[0].Tools.Exists("CancelInPut"))
  620. {
  621. toolMenu.Toolbars[0].Tools["CancelInPut"].InstanceProps.Visible = DefaultableBoolean.False;
  622. }
  623. if (toolMenu.Toolbars[0].Tools.Exists("DoBeside"))
  624. {
  625. toolMenu.Toolbars[0].Tools["DoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  626. }
  627. if (toolMenu.Toolbars[0].Tools.Exists("CancelDoBeside"))
  628. {
  629. toolMenu.Toolbars[0].Tools["CancelDoBeside"].InstanceProps.Visible = DefaultableBoolean.True;
  630. }
  631. }
  632. private void chkTim_CheckedChanged(object sender, EventArgs e)
  633. {
  634. this.StartTime.Enabled = this.EndTime.Enabled = this.chkTim.Checked;
  635. }
  636. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  637. {
  638. this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
  639. }
  640. private void entityGrid1_AfterRowActivate(object sender, EventArgs e)
  641. {
  642. UltraGridRow uRow = this.entityGrid1.ActiveRow;
  643. //if (uRow.HasChild())
  644. //{
  645. // return;
  646. //}
  647. if (uRow == null)
  648. {
  649. return;
  650. }
  651. ArrayList parmList = new ArrayList();
  652. parmList.Add(uRow.Cells["Furnaceno"].Text);
  653. parmList.Add(uRow.Cells["Sequenceno"].Text);
  654. parmList.Add(uRow.Cells["StoveNo"].Text);
  655. parmList.Add(uRow.Cells["JudgeStoveNoSeq"].Text);
  656. List<StlLgProgrrssEntity> listSource = EntityHelper.GetData<StlLgProgrrssEntity>(
  657. "Core.LgMes.Server.Stuffmanage.FrmStuffInputStore.doQueryStlLgProcess", new object[] { parmList }, this.ob);
  658. stlLgProgrrssEntityBindingSource.DataSource = listSource;
  659. foreach(UltraGridRow row in this.entityGrid2.Rows)
  660. {
  661. row.Cells["CHK"].Value = "True";
  662. }
  663. }
  664. private void txtStoveNo_KeyDown(object sender, KeyEventArgs e)
  665. {
  666. if(e.KeyValue == 13)
  667. {
  668. doQueryPlan();
  669. }
  670. }
  671. }
  672. }