frmPipeInventoryIn .cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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 Core.StlMes.Client.YdmPipeManage.Controls;
  12. using Core.Mes.Client.Comm.Tool;
  13. using Core.Mes.Client.Comm.Server;
  14. using Core.Mes.Client.Comm.Control;
  15. using Infragistics.Win.UltraWinGrid;
  16. using Infragistics.Win;
  17. using Core.StlMes.Client.YdmPipeManage.Tool;
  18. using com.steering.pss.ydm.entity;
  19. using Core.StlMes.Client.YdmPipeManage.Dialog;
  20. using Core.StlMes.Client.YdmPipeManage.Entity;
  21. using Infragistics.Win.UltraWinToolTip;
  22. using Core.StlMes.Client.YdmBase;
  23. namespace Core.StlMes.Client.YdmPipeManage
  24. {
  25. public partial class frmPipeInventoryIn : FrmBase
  26. {
  27. public frmPipeInventoryIn()
  28. {
  29. InitializeComponent();
  30. }
  31. private void frmPipeInventoryIn_Load(object sender, EventArgs e)
  32. {
  33. BaseMethod.InitStorage(cmbStorage, CustomInfo, this.ValidDataPurviewIds, this.ob);
  34. EntityHelper.ShowGridCaption<YdmZcStocktakinglistEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  35. InitDropBox();
  36. BaseMethod.InitGrade(cmbGrade, this.ob);
  37. RegStartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddMonths(-1);
  38. RegEndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1).AddSeconds(-1);
  39. //BaseMethod.setOtherColumnReadOnly(ultraGrid1, new string[] { "Chc" });
  40. BaseMethod.InitCellPosition(ultraGrid1, new string[] { "ActWeight", "ActCount", "ActLenMax", "ActLenMin", "ActTheoryWeight", "ActHeight", "ActDimater" });
  41. ultraGrid1.DisplayLayout.Bands[0].Columns["StocktakingRsnName"].Header.Caption = "盘盈原因";
  42. }
  43. /// <summary>
  44. /// 重写基类方法
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="ToolbarKey"></param>
  48. public override void ToolBar_Click(object sender, string ToolbarKey)
  49. {
  50. switch (ToolbarKey)
  51. {
  52. case "Query":
  53. DoQuery();
  54. break;
  55. case "Add":
  56. DoAdd();
  57. break;
  58. case "updateYear":
  59. updateYear();
  60. break;
  61. case "Export":
  62. GridHelper.ulGridToExcel(ultraGrid1, "盘盈实绩");
  63. break;
  64. case "Close":
  65. this.Close();
  66. break;
  67. }
  68. }
  69. /// <summary>
  70. /// 调整结转年月
  71. /// </summary>
  72. private void updateYear()
  73. {
  74. this.ultraGrid1.UpdateData();
  75. ArrayList list = new ArrayList();
  76. ArrayList parm = new ArrayList();
  77. UltraGridRow uRow = this.ultraGrid1.ActiveRow;
  78. string yearMoth = uRow.Cells["balYearMonth"].Text.Substring(0, 4) + uRow.Cells["balYearMonth"].Text.Substring(5, 2);
  79. string adjustDoc = uRow.Cells["stocktakingDoc"].Value.ToString();
  80. string heatNo = uRow.Cells["judgeStoveNo"].Value.ToString();
  81. string bacthNo = uRow.Cells["batchNo"].Value.ToString();
  82. string bacthGroupNo = uRow.Cells["batchGroudNo"].Value.ToString();
  83. //string moth = DateTime.Now.AddMonths(1).ToString("yyyyMM");
  84. string moth = DateTime.Parse(uRow.Cells["balYearMonth"].Text).AddMonths(1).ToString("yyyyMM");
  85. string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,ob);
  86. //parm.Add(heatNo);
  87. //parm.Add(bacthNo);
  88. //parm.Add(bacthGroupNo);
  89. parm.Add(moth);
  90. DataTable ds = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.selectYearMoth", new object[] { parm, arr }, ob);
  91. if (int.Parse(ds.Rows[0]["ACOUNT"].ToString()) > 0)
  92. {
  93. MessageUtil.ShowTips("此炉【" + heatNo + "】已进行结转,不允许调整结转年月!");
  94. return;
  95. }
  96. string nowYearMoth = DateTime.Now.ToString("yyyyMM");
  97. //if (int.Parse(yearMoth) < int.Parse(nowYearMoth))
  98. //{
  99. // MessageUtil.ShowTips("修改的结转年月不能小于当月!");
  100. // return;
  101. //}
  102. list.Add(yearMoth);
  103. list.Add(yearMoth + "02 12:00:00");
  104. list.Add(adjustDoc);
  105. int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.updateYear", new object[] { list }, ob);
  106. if (count > 0)
  107. {
  108. DoQuery();
  109. MessageUtil.ShowTips("修改成功");
  110. }
  111. }
  112. /// <summary>
  113. /// 编辑区下拉框绑定
  114. /// </summary>
  115. private void InitDropBox()
  116. {
  117. //产线
  118. BaseMethod.InitPline(TxtPline, this.ob);
  119. DataTable dt= ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.queryMaterialSTyle", new object[] { }, ob);
  120. TxtProductFlag.DataSource = dt;
  121. TxtProductFlag.DisplayMember="BASENAME";
  122. TxtProductFlag.ValueMember = "BASENAME";
  123. BaseMethod.InitSourse(TxtSourse, this.ob);
  124. TxtSourse.Value = "801305";
  125. BaseMethod.InitReason(TxtReason, this.ob);
  126. BaseMethod.InitStorage(TxtStorage, CustomInfo, this.ValidDataPurviewIds, this.ob);
  127. BaseMethod.InitJustResult(cmbResult, this.ob);
  128. // BaseMethod.InitBelongCode(TxtBelongCode, this.ob);
  129. }
  130. /// <summary>
  131. /// 查询
  132. /// </summary>
  133. private void DoQuery()
  134. {
  135. ArrayList param = new ArrayList();
  136. string strBegin = "1900-01-01 00:00:00";
  137. string strEnd = "9900-01-01 00:00:00";
  138. string justStoveNo = "";
  139. string stoveNo = "";//仓库号;
  140. string locationNo = "";//料位号
  141. //string[] stoveages = BaseMethod.WarehousePermissions(CustomInfo, this.ValidDataPurviewIds, this.ob);
  142. string[] stoveages = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
  143. if (chkRegTime.Checked)
  144. {
  145. if (RegStartTime.Value == null || RegEndTime.Value == null)
  146. {
  147. MessageUtil.ShowWarning("请选择正确的创建时间");
  148. return;
  149. }
  150. strBegin = RegStartTime.Value.ToString();
  151. strEnd = RegEndTime.Value.ToString();
  152. }
  153. if (chkFurnace.Checked)
  154. {
  155. justStoveNo = txtFurnace.Text.Trim();
  156. }
  157. if (chkWarehous.Checked && cmbStorage.Value != null)
  158. {
  159. stoveNo = cmbStorage.Value.ToString();
  160. }
  161. if (chkMaterial.Checked && cmbLocation.Value != null)
  162. {
  163. locationNo = cmbLocation.Value.ToString();
  164. }
  165. param.Add(strBegin);
  166. param.Add(strEnd);
  167. param.Add(justStoveNo);
  168. param.Add(stoveNo);
  169. param.Add(locationNo);
  170. List<OYdmZcStorcktakinglistEntity> listSource = EntityHelper.GetData<OYdmZcStorcktakinglistEntity>(
  171. "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getYdmZcStocktakingList", new object[] { param, stoveages,this.CustomInfo.ToString2() }, this.ob);
  172. ydmZcStocktakinglistEntityBindingSource.DataSource = listSource;
  173. }
  174. /// <summary>
  175. /// 新增
  176. /// </summary>
  177. private void DoAdd()
  178. {
  179. OYdmZcStorcktakinglistEntity entity = GetAddData();
  180. string errMessage = CheckAdd(entity);
  181. if (errMessage.Length > 0)
  182. {
  183. MessageUtil.ShowWarning(errMessage);
  184. return;
  185. }
  186. if (MessageUtil.ShowYesNoAndQuestion("是否新增盘盈信息?") == DialogResult.No)
  187. {
  188. return;
  189. }
  190. CoreClientParam ccp = new CoreClientParam();
  191. ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn";
  192. ccp.MethodName = "doAdd";
  193. ccp.ServerParams = new object[] { entity };
  194. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  195. if (ccp.ReturnCode != -1)
  196. {
  197. DoQuery();
  198. if (!ccp.ReturnInfo.Contains(","))
  199. {
  200. MessageUtil.ShowTips(ccp.ReturnInfo);
  201. }
  202. else
  203. {
  204. string[] message = ccp.ReturnInfo.Split(',');
  205. MessageUtil.ShowTips(message[0]);
  206. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  207. {
  208. if (ugr.Cells["StocktakingDoc"].Value.ToString().Equals(message[1]))
  209. {
  210. ugr.Activate();
  211. break;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. private OYdmZcStorcktakinglistEntity GetAddData()
  218. {
  219. OYdmZcStorcktakinglistEntity entity = new OYdmZcStorcktakinglistEntity();
  220. entity.StocktakingTypeCode = "800601";
  221. entity.StocktakingTypeName = "盘盈";
  222. entity.StocktakingRsnCode = TxtReason.Value == null ? "" : TxtReason.Value.ToString();
  223. entity.StocktakingRsnName = TxtReason.Text.Trim();
  224. entity.JudgeStoveNo = TxtStoveNo.Text.Trim();
  225. entity.BatchNo = TxtBathNo.Text.Trim();
  226. entity.BatchGroudNo = "1";
  227. entity.MaterialNo = TxtMaterial.Tag == null ? "" : TxtMaterial.Tag.ToString();
  228. entity.MaterialName = TxtMaterial.Text;
  229. entity.Produccode = TxtProduc.Tag == null ? "" : TxtProduc.Tag.ToString();
  230. entity.Producname = TxtProduc.Text;
  231. entity.StdCode = TxtStdName.Tag == null ? "" : TxtStdName.Tag.ToString();
  232. entity.StdName = TxtStdName.Text;
  233. entity.Steelcode = TxtSteelCode.Tag == null ? "" : TxtSteelCode.Tag.ToString();
  234. entity.Steelname = TxtSteelCode.Text;
  235. entity.StdStyle = TxtStdStyle.Tag == null ? "" : TxtStdStyle.Tag.ToString();
  236. entity.StdStyleDesc = TxtStdStyle.Text;
  237. entity.SpecCode = TxtSpcName.Tag == null ? "" : TxtSpcName.Tag.ToString();
  238. entity.SpecName = TxtSpcName.Text;
  239. entity.ModelCode = TxtModel.Tag == null ? "" : TxtModel.Tag.ToString();
  240. entity.ModelDesc = TxtModel.Text;
  241. entity.PlineCode = TxtPline.Value == null ? "" : TxtPline.Value.ToString();
  242. entity.PlineName = TxtPline.Text;
  243. entity.ActDimater = TxtDimater.Text;
  244. entity.ActHeight = TxtHeight.Text;
  245. entity.ActLenMax = TxtMax.Value == null ? "" : TxtMax.Value.ToString();
  246. entity.ActLenMin = TxtMin.Value == null ? "" : TxtMin.Value.ToString();
  247. entity.ActCount = TxtNum.Text.Trim();
  248. entity.ActWeight = TxtActWgt.Value == null ? "" : TxtActWgt.Value.ToString();
  249. entity.ActLen = TxtActLen.Value == null ? "" : TxtActLen.Value.ToString();
  250. //entity.ActTheoryWeight = TxtWgt.Value == null ? "" : TxtWgt.Value.ToString();
  251. entity.BelongCode = TxtBelongCode.Value == null ? "" : TxtBelongCode.Value.ToString();
  252. entity.BelongName = TxtBelongCode.Text;
  253. entity.StorageNo = TxtStorage.Value == null ? "" : TxtStorage.Value.ToString();
  254. entity.LocationNo = TxtLocation.Value == null ? "" : TxtLocation.Value.ToString();
  255. entity.CreateName = UserInfo.GetUserName();
  256. entity.Memo = ultraTextEditor1.Text.Trim();
  257. entity.MatOriginCode = TxtSourse.Value == null ? "" : TxtSourse.Value.ToString();
  258. entity.MatOriginName = TxtSourse.Text;
  259. entity.MatStatus = TxtMagstatus.Value == null ? "" : TxtMagstatus.Value.ToString();
  260. entity.ProductFlag = TxtProductFlag.Value == null ? "" : TxtProductFlag.Value.ToString();
  261. entity.JudgeResultCode = cmbResult.Value == null ? "" : cmbResult.Value.ToString();
  262. entity.JudgeResult = cmbResult.Text;
  263. entity.BalYearMonth = DateTime.Now.ToString("yyyyMM");
  264. entity.SoureCode = TxtPline.Value == null ? "" : TxtPline.Value.ToString();
  265. entity.SoureName = TxtPline.Text;
  266. entity.Gradecode = cmbGrade.Value == null ? "" : cmbGrade.Value.ToString();
  267. entity.Gradename = cmbGrade.Text;
  268. entity.SupplyUnit = this.CustomInfo.Equals("120504") ? "江苏天淮钢管有限公司" : "天津钢管制造有限公司";
  269. entity.SupplyUnitCode = this.CustomInfo.Equals("120504") ? "120504" : "120501";
  270. return entity;
  271. }
  272. //新增时验证必填项
  273. private string CheckAdd(OYdmZcStorcktakinglistEntity entity)
  274. {
  275. if (entity.MaterialNo.Equals(""))
  276. {
  277. return "请选择产品信息!";
  278. }
  279. if (entity.Produccode.Equals(""))
  280. {
  281. return "请选择产品信息!";
  282. }
  283. if (entity.StdCode.Equals(""))
  284. {
  285. return "请选择产品信息!";
  286. }
  287. if (entity.SpecCode.Equals(""))
  288. {
  289. return "请选择产品信息!";
  290. }
  291. if (entity.ProductFlag.Equals(""))
  292. {
  293. return "请选择材料类别!";
  294. }
  295. if (entity.MatStatus.Equals(""))
  296. {
  297. return "请选择材料状态!";
  298. }
  299. if (entity.ActLenMax.Equals("") || Convert.ToDouble(entity.ActLenMax.ToString()) <= 0)
  300. {
  301. return "请输入长度上限!";
  302. }
  303. if (entity.ActLenMin.Equals("") || Convert.ToDouble(entity.ActLenMin.ToString()) <= 0)
  304. {
  305. return "请输入长度下限!";
  306. }
  307. if (Convert.ToDouble(entity.ActLenMax.ToString()) < Convert.ToDouble(entity.ActLenMin.ToString()))
  308. {
  309. return "长度上限不能小于长度下限";
  310. }
  311. if (entity.MatOriginCode.Equals(""))
  312. {
  313. return "请选择材料来源!";
  314. }
  315. if (entity.ActCount.Equals("") || Convert.ToDouble(entity.ActCount.ToString()) <= 0)
  316. {
  317. return "请输入支数!";
  318. }
  319. if (entity.ActWeight.Equals("") || Convert.ToDouble(entity.ActWeight.ToString()) <= 0)
  320. {
  321. return "请输入实重!";
  322. }
  323. if (entity.BelongCode.Equals(""))
  324. {
  325. return "请选择销售组织";
  326. }
  327. if (entity.StorageNo.Equals(""))
  328. {
  329. return "请选择仓库号!";
  330. }
  331. //if (entity.LocationNo.Equals(""))
  332. //{
  333. // return "请选择料位号!";
  334. //}
  335. if (entity.StocktakingRsnCode.Equals(""))
  336. {
  337. return "请选择盘盈原因!";
  338. }
  339. if (entity.JudgeStoveNo.Equals("") || entity.JudgeStoveNo.ToString().Length != 6 || (!StringUtil.IsOnlyLetterAndDigit(entity.JudgeStoveNo.ToString())))
  340. {
  341. return "炉号由6位数字和字母组成!";
  342. }
  343. //if (entity.PlineCode.Equals(""))
  344. //{
  345. // return "请选择产线!";
  346. //}
  347. if (entity.BatchNo.Equals("") || entity.BatchNo.ToString().Length > 3 || entity.BatchNo.ToString().Length < 2 || (!StringUtil.IsOnlyLetterAndDigit(entity.BatchNo.ToString())))
  348. {
  349. return "批号由2-3位数字和字母组成!";
  350. }
  351. if (entity.JudgeResultCode.Equals(""))
  352. {
  353. return "请选择判定结果!";
  354. }
  355. return "";
  356. }
  357. //--------------2015/08/13
  358. private void chkWarehous_CheckedChanged(object sender, EventArgs e)
  359. {
  360. if (chkWarehous.Checked)
  361. {
  362. cmbStorage.Enabled = true;
  363. chkMaterial.Enabled = true;
  364. if (chkMaterial.Checked)
  365. {
  366. cmbLocation.Enabled = true;
  367. }
  368. else
  369. {
  370. cmbLocation.Enabled = false;
  371. }
  372. }
  373. else
  374. {
  375. chkMaterial.Checked = false;
  376. cmbStorage.Enabled = false;
  377. chkMaterial.Enabled = false;
  378. cmbLocation.Enabled = false;
  379. }
  380. }
  381. private void cmbStorage_SelectionChanged(object sender, EventArgs e)
  382. {
  383. if (cmbStorage.Value == null)
  384. {
  385. cmbLocation.DataSource = null;
  386. return;
  387. }
  388. string storageNo = cmbStorage.Value.ToString();
  389. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getLocationNo", new object[] { storageNo }, this.ob);
  390. cmbLocation.DataSource = dt;
  391. cmbLocation.DisplayMember = "LOCATION_NO";
  392. cmbLocation.ValueMember = "LOCATION_NO";
  393. }
  394. /// <summary>
  395. /// 验证Checked是否勾选,显示控件可编辑 打勾表示可编辑,不打勾表示不可编辑
  396. /// </summary>
  397. /// <param name="sender"></param>
  398. /// <param name="e"></param>
  399. private void chk_CheckedChanged(object sender, EventArgs e)
  400. {
  401. if (chkFurnace.Checked) { txtFurnace.Enabled = true; } else { txtFurnace.Enabled = false; }
  402. if (chkMaterial.Checked)
  403. {
  404. cmbLocation.Enabled = true;
  405. }
  406. else
  407. {
  408. cmbLocation.Enabled = false;
  409. }
  410. }
  411. /// <summary>
  412. /// 物料信息选择
  413. /// </summary>
  414. /// <param name="sender"></param>
  415. /// <param name="e"></param>
  416. private void button1_Click(object sender, EventArgs e)
  417. {
  418. //FrmMaterialDialog frmMaterialDialog = new FrmMaterialDialog("","0", this.ob);
  419. //frmMaterialDialog.ShowDialog();
  420. //SlmBaseMaterialEntity baseEntity = frmMaterialDialog.BaseEntity;
  421. //ComPscEntity pscEntity = frmMaterialDialog.PscEntity;
  422. //if (baseEntity == null || pscEntity == null)
  423. //{
  424. // return;
  425. //}
  426. //TxtMaterial.Tag = baseEntity.MaterialNo.ToString();
  427. //TxtMaterial.Text = baseEntity.MaterialDesc.ToString();
  428. //TxtProduc.Tag = baseEntity.Produccode.ToString();
  429. //TxtProduc.Text = baseEntity.Producname.ToString();
  430. //TxtStdName.Tag = pscEntity.StdCode.ToString();
  431. //TxtStdName.Text = pscEntity.StdName.ToString();
  432. //TxtStdStyle.Tag = baseEntity.StdStyle == null ? "" : baseEntity.StdStyle.ToString();
  433. //TxtStdStyle.Text = baseEntity.StdStyleDesc == null ? "" : baseEntity.StdStyleDesc.ToString();
  434. //TxtSpcName.Tag = baseEntity.SpecCode.ToString();
  435. //TxtSpcName.Text = baseEntity.SpecName.ToString();
  436. //TxtModel.Tag = baseEntity.ModelCode == null ? "" : baseEntity.ModelCode.ToString();
  437. //TxtModel.Text = baseEntity.ModelDesc == null ? "" : baseEntity.ModelDesc.ToString();
  438. //TxtDimater.Value = baseEntity.Dimater.ToString();
  439. //TxtHeight.Value = baseEntity.Height.ToString();
  440. //TxtSteelCode.Tag = baseEntity.Steelcode.ToString();
  441. //TxtSteelCode.Text = baseEntity.Steelname.ToString();
  442. }
  443. private void TxtProductFlag_SelectionChanged(object sender, EventArgs e)
  444. {
  445. if (TxtProductFlag.Value == null)
  446. {
  447. TxtMagstatus.DataSource = null;
  448. return;
  449. }
  450. else
  451. {
  452. string value = TxtProductFlag.Value.ToString();
  453. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getmagStatus", new object[] { value }, this.ob);
  454. BaseMethod.InitComboEditor(TxtMagstatus, dt, "BASENAME", "BASECODE");
  455. }
  456. }
  457. private void TxtStorage_SelectionChanged(object sender, EventArgs e)
  458. {
  459. if (TxtStorage.Value == null)
  460. {
  461. TxtLocation.DataSource = null;
  462. return;
  463. }
  464. string storageNo = TxtStorage.Value.ToString();
  465. DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeInventoryIn.getLocationNo", new object[] { storageNo }, this.ob);
  466. TxtLocation.DataSource = dt;
  467. TxtLocation.DisplayMember = "LOCATION_NO";
  468. TxtLocation.ValueMember = "LOCATION_NO";
  469. }
  470. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  471. {
  472. UltraGridRow ugr = ultraGrid1.ActiveRow;
  473. if (ugr == null)
  474. {
  475. return;
  476. }
  477. TxtMaterial.Tag = ugr.Cells["MaterialNo"].Text;
  478. TxtMaterial.Text = ugr.Cells["MaterialName"].Text;
  479. TxtSpcName.Tag = ugr.Cells["SpecCode"].Text;
  480. TxtSpcName.Text = ugr.Cells["SpecName"].Text;
  481. TxtProduc.Tag = ugr.Cells["Produccode"].Text;
  482. TxtProduc.Text = ugr.Cells["Producname"].Text;
  483. TxtModel.Tag = ugr.Cells["ModelCode"].Text;
  484. TxtModel.Text = ugr.Cells["ModelDesc"].Text;
  485. TxtStdName.Tag = ugr.Cells["StdCode"].Text;
  486. TxtStdName.Text = ugr.Cells["StdName"].Text;
  487. TxtDimater.Value = ugr.Cells["ActDimater"].Text;
  488. TxtHeight.Value = ugr.Cells["ActHeight"].Text;
  489. TxtStdStyle.Tag = ugr.Cells["StdStyle"].Text;
  490. TxtStdStyle.Text = ugr.Cells["StdStyleDesc"].Text;
  491. TxtSteelCode.Tag = ugr.Cells["Steelcode"].Text;
  492. TxtSteelCode.Text = ugr.Cells["Steelname"].Text;
  493. TxtMax.Value = ugr.Cells["ActLenMax"].Text;
  494. TxtMin.Value = ugr.Cells["ActLenMin"].Text;
  495. TxtNum.Value = ugr.Cells["ActCount"].Text;
  496. TxtActWgt.Value = ugr.Cells["ActWeight"].Text;
  497. TxtBelongCode.Value = ugr.Cells["BelongCode"].Text;
  498. TxtStorage.Value = ugr.Cells["StorageNo"].Text;
  499. TxtLocation.Value = ugr.Cells["LocationNo"].Text;
  500. TxtReason.Value = ugr.Cells["StocktakingRsnCode"].Text;
  501. TxtStoveNo.Value = ugr.Cells["JudgeStoveNo"].Text;
  502. TxtPline.Value = ugr.Cells["PlineCode"].Text;
  503. TxtBathNo.Value = ugr.Cells["BatchNo"].Text;
  504. }
  505. private void TxtSourse_ValueChanged(object sender, EventArgs e)
  506. {
  507. if (this.TxtSourse.Text != "")
  508. {
  509. if (this.TxtSourse.Value.ToString() == "801302")//产线
  510. {
  511. YdmBaseClass.InitComboEditor(TxtPline, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getFactoryDetail", "PLINE_CODE", this.ob, false);
  512. }
  513. else if (this.TxtSourse.Value.ToString() == "801301")//外购
  514. {
  515. YdmBaseClass.InitComboEditor(TxtPline, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getWg", "BASE_CODE", this.ob, false);
  516. }
  517. else if (this.TxtSourse.Value.ToString() == "801303")//倒库
  518. {
  519. YdmBaseClass.InitComboEditor(TxtPline, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getDk", "BASE_CODE", this.ob, false);
  520. }
  521. else if (this.TxtSourse.Value.ToString() == "801304")//外委
  522. {
  523. YdmBaseClass.InitComboEditor(TxtPline, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getWw", "BASE_CODE", this.ob, false);
  524. }
  525. }
  526. }
  527. }
  528. }