F_PC_0102_1_1.cs 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PC_0102_1_1.cs
  5. * 2.功能描述:新建成型线信息
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2015/09/25 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Windows.Forms;
  15. using Dongke.IBOSS.PRD.Basics.BaseControls;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Client.CommonModule;
  18. using Dongke.IBOSS.PRD.Client.Controls;
  19. using Dongke.IBOSS.PRD.Client.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.DataModels;
  21. using Dongke.IBOSS.PRD.WCF.Proxys;
  22. namespace Dongke.IBOSS.PRD.Client.PCModule
  23. {
  24. public partial class F_PC_0102_1_1 : FormBase
  25. {
  26. #region 成员变量
  27. //需要添加的成型线明细集合
  28. public List<GroutingLineDetailEntity> _addDetailList = new List<GroutingLineDetailEntity>();
  29. //需要添加的成型工号明细集合
  30. public List<GroutingLineUserEntity> _addDetailUserList = new List<GroutingLineUserEntity>();
  31. //模具总数量
  32. private int _mouldCount = 0;
  33. //是否已经提示过删除模具的信息
  34. private bool _isMessageShow = false;
  35. //
  36. private string _userCodeValue;
  37. private bool _ShowFlag = true;
  38. #endregion
  39. #region 构造函数
  40. public F_PC_0102_1_1()
  41. {
  42. InitializeComponent();
  43. this.Text = FormTitles.F_PC_0102;
  44. this.btnSave.Text = ButtonText.BTN_SAVE;
  45. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  46. this.btnAddMould.Text = ButtonText.BTN_ADDMOULD;
  47. this.btnDeleteSelected.Text = ButtonText.BTN_DELETESELECTED;
  48. //this.dkUser.IsWorker = true;
  49. this.dgvUser.AutoGenerateColumns = false;
  50. this.dgvDetail.AutoGenerateColumns = false;
  51. DataTable dtUser = new DataTable();
  52. dtUser.Columns.Add("UserID");
  53. dtUser.Columns.Add("UserCode");
  54. dtUser.Columns.Add("UserName");
  55. dtUser.Columns.Add("StaffNames");
  56. dtUser.Columns.Add("Remark");
  57. dtUser.Columns["UserID"].Unique = true;
  58. this.dgvUser.DataSource = dtUser;
  59. this.scbUser1.DisplayMember = "USERNAMECode";
  60. this.scbUser1.ValueMember = "UserID";
  61. }
  62. #endregion
  63. #region 事件
  64. /// <summary>
  65. /// 自适应列宽
  66. /// </summary>
  67. /// <param name="sender"></param>
  68. /// <param name="e"></param>
  69. private void btnAdaptive_Click(object sender, EventArgs e)
  70. {
  71. this.dgvUser.AutoResizeColumns();
  72. this.dgvDetail.AutoResizeColumns();
  73. }
  74. /// <summary>
  75. /// 添加成型线明细
  76. /// </summary>
  77. private void btnAddMould_Click(object sender, EventArgs e)
  78. {
  79. try
  80. {
  81. if (this.txtGroutingLineCode.Text == string.Empty)
  82. {
  83. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型线编码"), this.Text,
  84. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  85. return;
  86. }
  87. if (string.IsNullOrEmpty(this.txtBeginNum.Text))
  88. {
  89. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "起始模具号"), this.Text,
  90. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  91. return;
  92. }
  93. if (this.txtCount.Text == string.Empty)
  94. {
  95. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "模具数量"), this.Text,
  96. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  97. return;
  98. }
  99. if (this.scbGoods.SearchedPKMember == 0)
  100. {
  101. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "模具产品"), this.Text,
  102. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  103. return;
  104. }
  105. if (Convert.ToInt32(txtBeginNum.Text) + Convert.ToInt32(txtCount.Text) > 999)
  106. {
  107. MessageBox.Show("成型线模具数量不可超过999个!", this.Text,
  108. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  109. return;
  110. }
  111. //if (this._mouldCount == 999)
  112. //{
  113. // MessageBox.Show("成型线模具数量不可超过999个!", this.Text,
  114. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  115. // return;
  116. //}
  117. if (this._isMessageShow == false)
  118. {
  119. DialogResult msgBoxResult = MessageBox.Show("添加模具后,成型线编码相关信息不予许修改,是否继续。",
  120. this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  121. if (msgBoxResult == DialogResult.No)
  122. {
  123. return;
  124. }
  125. else
  126. {
  127. this.txtBuildingNo.ReadOnly = true;
  128. this.txtFloorNo.ReadOnly = true;
  129. this.txtGroutingLineNo.ReadOnly = true;
  130. }
  131. this._isMessageShow = true;
  132. }
  133. //for (int i = 0; i < _addDetailList.Count; i++)
  134. //{
  135. // DataRow drRow = dtDataSourse.NewRow();
  136. // drRow["GROUTINGMOULDCODE"] = _addDetailList[i].GROUTINGMOULDCODE;
  137. // drRow["GOODSNAME"] = _addDetailList[i].GOODSNAME;
  138. // drRow["GoodsCode"] = _addDetailList[i].GOODSCODE;
  139. // drRow["GoodsSpecification"] = _addDetailList[i].GoodsSpecification;
  140. // drRow["GOODSID"] = _addDetailList[i].GOODSID;
  141. // dtDataSourse.Rows.Add(drRow);
  142. //}
  143. bool isError = false;
  144. DataTable dtDetail = this.dgvDetail.DataSource as DataTable;
  145. int BeginNum = Convert.ToInt32(this.txtBeginNum.Text);
  146. for (int i = 0; i < Convert.ToInt32(this.txtCount.Text); i++)
  147. {
  148. ////// int GroutingMouldCodeNum = BeginNum + _mouldCount;
  149. //// int GroutingMouldCodeNum = BeginNum ;
  150. //// GroutingLineDetailEntity detailInfo = new GroutingLineDetailEntity();
  151. //// detailInfo.GROUTINGMOULDCODE = this.txtGroutingLineCode.Text + "-" + (GroutingMouldCodeNum).ToString().PadLeft(3, '0');
  152. //// if (dtDetail != null)
  153. //// {
  154. //// DataRow[] dr = dtDetail.Select("GROUTINGMOULDCODE='" + detailInfo.GROUTINGMOULDCODE + "'");
  155. //// if (dr.Length > 0)
  156. //// {
  157. //// isError = true;
  158. //// break;
  159. //// }
  160. //// }
  161. //// detailInfo.MOULDCODE = Guid.NewGuid().ToString().ToUpper();
  162. //// detailInfo.GOODSID = Convert.ToInt32(this.dkGoods.GoodsID);
  163. //// detailInfo.GOODSNAME = this.dkGoods.GoodsName;
  164. //// detailInfo.GOODSCODE = this.dkGoods.GoodsCode;
  165. //// detailInfo.GoodsSpecification = this.dkGoods.GoodsSpecification;
  166. //// detailInfo.GROUTINGCOUNT = Constant.INT_IS_ZERO;
  167. //// detailInfo.MOULDSTATUS = Convert.ToInt32(Constant.GMouldStatus.Normal);
  168. //// detailInfo.REMARKS = "";
  169. //// detailInfo.VALUEFLAG = 1;
  170. //// this._addDetailList.Add(detailInfo);
  171. //// BeginNum = BeginNum + 1;
  172. int GroutingMouldCodeNum = BeginNum;
  173. //GroutingLineDetailEntity detailInfo = new GroutingLineDetailEntity();
  174. string MOULDCODE = this.txtGroutingLineCode.Text + "-" + (GroutingMouldCodeNum).ToString().PadLeft(3, '0');
  175. DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  176. DataRow[] dr = dtInfo.Select("GroutingMouldCode='" + MOULDCODE + "'");
  177. if (dr.Length > 0)
  178. {
  179. isError = true;
  180. break;
  181. };
  182. //if (dtDetail != null)
  183. //{
  184. // DataRow[] dr = dtDetail.Select("GROUTINGMOULDCODE='" + detailInfo.GROUTINGMOULDCODE + "'");
  185. // if (dr.Length > 0)
  186. // {
  187. // isError = true;
  188. // break;
  189. // }
  190. //}
  191. DataRow r = dtInfo.NewRow();
  192. r["GroutingMouldCode"] = MOULDCODE;
  193. r["MouldSource"] = "0";
  194. r["MOULDCODE"] = Guid.NewGuid().ToString().ToUpper();
  195. r["GOODSID"] = scbGoods.SearchedPKMember;
  196. r["GOODSNAME"] = scbGoods.SearchedItem["GOODSNAME"];
  197. r["GOODSCODE"] = scbGoods.SearchedItem["GOODSCODE"];
  198. r["GoodsSpecification"] = scbGoods.SearchedItem["GOODSSPECIFICATION"];
  199. r["GROUTINGCOUNT"] = Convert.ToInt32(this.txtGroutingCount.DataValue ?? 0);
  200. r["StandardGroutingCount"] = Convert.ToInt32(this.txtStandardGroutingCount.DataValue.Value);
  201. r["MOULDSTATUS"] = Convert.ToInt32(Constant.GMouldStatus.Normal);
  202. //r["REMARKS"] = "";
  203. r["VALUEFLAG"] = "1";
  204. dtInfo.Rows.Add(r);
  205. //this._addDetailList.Add(detailInfo);
  206. BeginNum = BeginNum + 1;
  207. }
  208. if (isError)
  209. {
  210. BeginNum = Convert.ToInt32(this.txtBeginNum.Text);
  211. //有错误
  212. MessageBox.Show("存在相同的模具编号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  213. return;
  214. }
  215. else
  216. {
  217. this.txtBeginNum.DataValue = BeginNum;
  218. }
  219. this._mouldCount += Convert.ToInt32(this.txtCount.Text);
  220. //this.dgvDetail.AutoGenerateColumns = false;
  221. //this.dgvDetail.DataSource = ListToTable();
  222. //this.dgvDetail.IsSetInputColumnsColor = true;
  223. //this.tabControl1.SelectTab(1);
  224. }
  225. catch (Exception ex)
  226. {
  227. // 对异常进行共通处理
  228. ExceptionManager.HandleEventException(this.ToString(),
  229. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  230. }
  231. }
  232. /// <summary>
  233. /// 关闭窗体
  234. /// </summary>
  235. private void btnCancel_Click(object sender, EventArgs e)
  236. {
  237. this.Close();
  238. }
  239. /// <summary>
  240. /// 删除明细
  241. /// </summary>
  242. private void btnDeleteSelected_Click(object sender, EventArgs e)
  243. {
  244. try
  245. {
  246. DataRowView drv = this.dgvDetail.CurrentRow.DataBoundItem as DataRowView;
  247. if (drv == null)
  248. {
  249. return;
  250. }
  251. // 一模多产时,同一模具一同清除。 add by chenxy 2018-10-29
  252. if (drv["MouldID"] != DBNull.Value)
  253. {
  254. DataTable dt = this.dgvDetail.DataSource as DataTable;
  255. DataRow[] drs = dt.Select("MouldID = " + drv["MouldID"]);
  256. if (drs.Length > 1)
  257. {
  258. foreach (DataRow item in drs)
  259. {
  260. item.Delete();
  261. }
  262. }
  263. else
  264. {
  265. drv.Delete();
  266. }
  267. }
  268. else
  269. {
  270. drv.Delete();
  271. }
  272. }
  273. catch (Exception ex)
  274. {
  275. // 对异常进行共通处理
  276. ExceptionManager.HandleEventException(this.ToString(),
  277. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  278. }
  279. }
  280. /// <summary>
  281. /// 提交新建
  282. /// </summary>
  283. private void btnSave_Click(object sender, EventArgs e)
  284. {
  285. try
  286. {
  287. int ErrorId = ValidationText();
  288. if (ErrorId != Constant.INT_IS_ZERO)
  289. {
  290. string errorAddress = "";
  291. switch (ErrorId)
  292. {
  293. case 1:
  294. this.txtBuildingNo.Focus();
  295. errorAddress = "楼号";
  296. break;
  297. case 2:
  298. this.txtFloorNo.Focus();
  299. errorAddress = "楼层";
  300. break;
  301. case 3:
  302. this.txtGroutingLineNo.Focus();
  303. errorAddress = "线号";
  304. break;
  305. case 4:
  306. this.txtGroutingLineCode.Focus();
  307. errorAddress = "成型线编码";
  308. break;
  309. case 5:
  310. this.txtGroutingLineName.Focus();
  311. errorAddress = "成型线名称";
  312. break;
  313. //case 7:
  314. // this.dkUser.Focus();
  315. // errorAddress = "工号";
  316. // break;
  317. case 8:
  318. this.scbGMouldType.Focus();
  319. errorAddress = "成型线类别";
  320. break;
  321. //xuwei add 2021-09-21
  322. case 9:
  323. this.txtWorkShop.Focus();
  324. errorAddress = "部门";
  325. break;
  326. //xuwei end
  327. default:
  328. break;
  329. };
  330. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, errorAddress),
  331. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  332. return;
  333. }
  334. if (LogInUserInfo.CurrentUser.CurrentUserEntity.AccountCode == "imex" &&
  335. this.scbUser1.SearchedValue == null)
  336. {
  337. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型班长"),
  338. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  339. return;
  340. }
  341. // 模具信息可以为空
  342. //DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  343. //if (dtInfo.Rows.Count == Constant.INT_IS_ZERO)
  344. //{
  345. // MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "模具信息"), this.Text,
  346. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  347. // return;
  348. //}
  349. DataTable dtUser = this.dgvUser.DataSource as DataTable;
  350. dtUser.TableName = "dtUser";
  351. dtUser.AcceptChanges();
  352. if (dtUser.Rows.Count == Constant.INT_IS_ZERO)
  353. {
  354. /* 成型线可以不绑定成型工号 chenxy 2019-10-08
  355. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型工号"), this.Text,
  356. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  357. this.tabControl1.SelectTab(0);
  358. return;
  359. */
  360. }
  361. else
  362. {
  363. DataRow[] dr = dtUser.Select("UserName='' or UserName is null");
  364. if (dr.Length > 0)
  365. {
  366. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型工号"), this.Text,
  367. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  368. this.tabControl1.SelectTab(0);
  369. return;
  370. }
  371. }
  372. //更新注浆次数
  373. DataTable dtDetail = this.dgvDetail.DataSource as DataTable;
  374. dtDetail.TableName = "dtDetail";
  375. GroutingLineEntity ginfo = new GroutingLineEntity();
  376. ginfo.BUILDINGNO = this.txtBuildingNo.Text.Trim();
  377. ginfo.FLOORNO = this.txtFloorNo.Text.Trim();
  378. ginfo.GROUTINGLINENO = this.txtGroutingLineNo.Text.Trim();
  379. ginfo.GROUTINGLINECODE = this.txtGroutingLineCode.Text.Trim();
  380. ginfo.GROUTINGLINENAME = this.txtGroutingLineName.Text.Trim();
  381. ginfo.REMARKS = this.txtRemarks.Text.Trim();
  382. //ginfo.USERID = this.dkUser.UserID;
  383. if (dtUser.Rows.Count > 0)
  384. {
  385. ginfo.USERID = Convert.ToInt32(dtUser.Rows[0]["UserID"]);
  386. }
  387. else
  388. {
  389. ginfo.USERID = null;
  390. }
  391. //xuwei add 2019-11-13 高压注浆
  392. ginfo.HIGHPRESSUREFLAG = HighPressureFlag.Checked ? 1 : 0;
  393. //xuwei end
  394. //xuwei add 2021-09-12 部门
  395. ginfo.WORKSHOP = Convert.ToInt32(txtWorkShop.Text);
  396. //xuwei end
  397. //2022年3月25日 17:37:27 by feiy 试验线
  398. ginfo.TestFlag = TestFlag.Checked ? 1 : 0;
  399. //end
  400. ginfo.MOULDTYPEID = this.scbGMouldType.SearchedPKMember;
  401. ginfo.MouldStatus = Convert.ToInt32(Constant.GMouldStatus.Normal);
  402. ginfo.VALUEFLAG = Convert.ToInt32(Constant.ValueFlag.Effective);
  403. ginfo.MOULDQUANTITY = dtDetail.Rows.Count;//this._addDetailList.Count;
  404. if (this.scbUser1.SearchedValue != null)
  405. {
  406. ginfo.MonitorID = Convert.ToInt32(this.scbUser1.SearchedValue);
  407. ginfo.MonitorCode = this.scbUser1.SearchedItem["Usercode"]+"";
  408. }
  409. this._addDetailUserList.Clear();
  410. //for (int i = 0; i < dtDetail.Rows.Count; i++)
  411. //{
  412. // _addDetailList[i].GROUTINGCOUNT = Convert.ToDecimal(dtDetail.Rows[i]["GROUTINGCOUNT"]);
  413. //}
  414. //foreach (DataRow r in dtUser.Rows)
  415. //{
  416. // GroutingLineUserEntity entity = new GroutingLineUserEntity();
  417. // entity.USERID = Convert.ToInt32(r["USERID"]);
  418. // entity.REMARK = r["REMARK"].ToString();
  419. // this._addDetailUserList.Add(entity);
  420. //}
  421. //DataTable dt = this.dgvDetail.DataSource as DataTable;
  422. //if (dt != null)
  423. //{
  424. // for (int i = 0; i < dt.Rows.Count; i++)
  425. // {
  426. // this._addDetailList[i].REMARKS = dt.Rows[i]["Remarks"].ToString();
  427. // }
  428. //}
  429. ServiceResultEntity myReturn = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
  430. {
  431. //return PCModuleProxy.Service.AddGroutingLine_New(ginfo, this._addDetailList, this._addDetailUserList);
  432. return PCModuleProxy.Service.AddGroutingLine_NewLine(ginfo, dtDetail, dtUser);
  433. }));
  434. if (myReturn != null)
  435. {
  436. if (myReturn.Status == Constant.ServiceResultStatus.Success)
  437. {
  438. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "成型线信息", "保存"),
  439. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  440. this.DialogResult = DialogResult.OK;
  441. }
  442. else if (myReturn.OtherStatus == -50)
  443. {
  444. MessageBox.Show("成型线编码已存在,请重新输入!",
  445. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  446. }
  447. else if (myReturn.OtherStatus == -2)
  448. {
  449. MessageBox.Show(Messages.MSG_CMN_W029,
  450. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  451. }
  452. }
  453. else
  454. {
  455. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "成型线信息", "保存"),
  456. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  457. }
  458. }
  459. catch (Exception ex)
  460. {
  461. // 对异常进行共通处理
  462. ExceptionManager.HandleEventException(this.ToString(),
  463. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  464. }
  465. }
  466. /// <summary>
  467. /// 编号变更
  468. /// </summary>
  469. private void txtBuildingNo_TextChanged(object sender, EventArgs e)
  470. {
  471. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  472. + this.txtGroutingLineNo.Text.Trim();
  473. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  474. + this.txtGroutingLineNo.Text.Trim();
  475. }
  476. /// <summary>
  477. /// 编号变更
  478. /// </summary>
  479. private void txtFloorNo_TextChanged(object sender, EventArgs e)
  480. {
  481. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  482. + this.txtGroutingLineNo.Text.Trim();
  483. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  484. + this.txtGroutingLineNo.Text.Trim();
  485. }
  486. /// <summary>
  487. /// 编号变更
  488. /// </summary>
  489. private void txtGroutingLineNo_TextChanged(object sender, EventArgs e)
  490. {
  491. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  492. + this.txtGroutingLineNo.Text.Trim();
  493. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  494. + this.txtGroutingLineNo.Text.Trim();
  495. }
  496. /// <summary>
  497. /// 成型线文本改变事件
  498. /// </summary>
  499. /// <param name="sender"></param>
  500. /// <param name="e"></param>
  501. private void txtGroutingLineCode_TextChanged(object sender, EventArgs e)
  502. {
  503. if (this._addDetailList.Count != Constant.INT_IS_ZERO)
  504. {
  505. MessageBox.Show("成型线编码变更后,需重新生成模具信息!",
  506. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  507. this._addDetailList.Clear();
  508. this._mouldCount = 0;
  509. this.dgvDetail.DataSource = null;
  510. }
  511. }
  512. /// <summary>
  513. /// 成型工号开始编辑事件
  514. /// </summary>
  515. /// <param name="sender"></param>
  516. /// <param name="e"></param>
  517. private void dgvUser_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
  518. {
  519. try
  520. {
  521. if (this.dgvUser.Rows.Count <= 1)
  522. {
  523. return;
  524. }
  525. DataGridViewColumn columnItem = this.dgvUser.Columns[e.ColumnIndex];
  526. if ("UserCode".Equals(columnItem.Name))
  527. {
  528. _userCodeValue = this.dgvUser.Rows[e.RowIndex].Cells[columnItem.Name].Value + "";
  529. }
  530. }
  531. catch (Exception ex)
  532. {
  533. // 对异常进行共通处理
  534. ExceptionManager.HandleEventException(this.ToString(),
  535. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  536. }
  537. }
  538. /// <summary>
  539. /// 工号单元格值改变事件
  540. /// </summary>
  541. /// <param name="sender"></param>
  542. /// <param name="e"></param>
  543. private void dgvUser_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  544. {
  545. try
  546. {
  547. if (this.dgvUser.Rows.Count <= 1 || !_ShowFlag)
  548. {
  549. return;
  550. }
  551. DataGridViewRow rowItem = this.dgvUser.Rows[e.RowIndex];
  552. DataGridViewColumn columnItem = this.dgvUser.Columns[e.ColumnIndex];
  553. // 用编号获取产品信息
  554. if ("UserCode".Equals(columnItem.Name))
  555. {
  556. _ShowFlag = false;
  557. FormUtility.BindUserRowDataSource(this.dgvUser,
  558. e.RowIndex, columnItem.Name, _userCodeValue);
  559. // 设置可输入单元格的颜色
  560. this.dgvUser.IsSetInputColumnsColor = true;
  561. }
  562. _ShowFlag = true;
  563. }
  564. catch (Exception ex)
  565. {
  566. //_ShowFlag = true;
  567. // 对异常进行共通处理
  568. ExceptionManager.HandleEventException(this.ToString(),
  569. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  570. }
  571. }
  572. /// <summary>
  573. /// 窗体加载事件
  574. /// </summary>
  575. /// <param name="sender"></param>
  576. /// <param name="e"></param>
  577. private void F_PC_0102_1_1_Load(object sender, EventArgs e)
  578. {
  579. // dgvDetail.IsSetInputColumnsColor = true;
  580. //dgvUser.IsSetInputColumnsColor = true;
  581. //窗体加载模具数据源
  582. this.dgvDetail.AutoGenerateColumns = false;
  583. DataTable dtGroutingInfo = new DataTable();
  584. dtGroutingInfo.Columns.Add("MouldSource");
  585. dtGroutingInfo.Columns.Add("MOULDID", typeof(int));
  586. dtGroutingInfo.Columns.Add("MOULDBarcode");
  587. dtGroutingInfo.Columns.Add("MOULDCODE");
  588. dtGroutingInfo.Columns.Add("GOODSID", typeof(int));
  589. dtGroutingInfo.Columns.Add("GOODSNAME");
  590. dtGroutingInfo.Columns.Add("GOODSCODE");
  591. dtGroutingInfo.Columns.Add("GoodsSpecification");
  592. dtGroutingInfo.Columns.Add("GROUTINGCOUNT", typeof(int));
  593. dtGroutingInfo.Columns.Add("StandardGroutingCount", typeof(int));
  594. dtGroutingInfo.Columns.Add("MOULDSTATUS", typeof(int));
  595. dtGroutingInfo.Columns.Add("REMARKS");
  596. dtGroutingInfo.Columns.Add("VALUEFLAG");
  597. dtGroutingInfo.Columns.Add("GroutingMouldCode");
  598. dtGroutingInfo.Columns.Add("MouldOutputNo", typeof(int));
  599. dtGroutingInfo.DefaultView.Sort = "GroutingMouldCode";
  600. dtGroutingInfo.Columns["GroutingMouldCode"].Unique = true;
  601. this.dgvDetail.DataSource = dtGroutingInfo;
  602. DataSet dsSetting = SystemModuleProxy.Service.GetSystemSettingDataByCode(Constant.SettingType.S_PC_001.ToString());
  603. if (dsSetting != null && dsSetting.Tables[0].Rows.Count > 0)
  604. {
  605. string flag = dsSetting.Tables[0].Rows[0]["SettingValue"].ToString();
  606. if (flag == "2")
  607. {
  608. this.rabBinding.Checked = true;
  609. this.rabAuto.Enabled = false;
  610. }
  611. else if (flag == "1")
  612. {
  613. this.rabBinding.Checked = true;
  614. }
  615. else
  616. {
  617. this.rabAuto.Checked = true;
  618. }
  619. }
  620. }
  621. /// <summary>
  622. /// 窗体加载后显示事件
  623. /// </summary>
  624. /// <param name="sender"></param>
  625. /// <param name="e"></param>
  626. private void F_PC_0102_1_1_Shown(object sender, EventArgs e)
  627. {
  628. //dgvDetail.IsSetInputColumnsColor = true;
  629. dgvUser.IsSetInputColumnsColor = true;
  630. }
  631. /// <summary>
  632. /// 工号排序事件
  633. /// </summary>
  634. /// <param name="sender"></param>
  635. /// <param name="e"></param>
  636. private void dgvUser_Sorted(object sender, EventArgs e)
  637. {
  638. this.dgvUser.IsSetInputColumnsColor = true;
  639. }
  640. /// <summary>
  641. /// 窗口切换事件
  642. /// </summary>
  643. /// <param name="sender"></param>
  644. /// <param name="e"></param>
  645. private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
  646. {
  647. //dgvDetail.IsSetInputColumnsColor = true;
  648. this.dgvUser.IsSetInputColumnsColor = true;
  649. }
  650. /// <summary>
  651. /// 行绘制前,控制Cell只读
  652. /// </summary>
  653. /// <param name="sender"></param>
  654. /// <param name="e"></param>
  655. private void dgvDetail_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
  656. {
  657. if (this.dgvDetail.ReadOnly || e.RowIndex < 0)
  658. {
  659. return;
  660. }
  661. try
  662. {
  663. if (string.IsNullOrEmpty(dgvDetail.Rows[e.RowIndex].Cells["MouldID"].Value + ""))
  664. {
  665. // 自动生成模具
  666. this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].ReadOnly = false;
  667. this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].ReadOnly = false;
  668. //this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].Style.BackColor
  669. // = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  670. //this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].Style.BackColor
  671. // = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  672. }
  673. else
  674. {
  675. // 模具档案
  676. this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].ReadOnly = true;
  677. this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].ReadOnly = true;
  678. //this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].Style.BackColor
  679. // = Color.White;
  680. //this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].Style.BackColor
  681. //= Color.White;
  682. }
  683. foreach (DataGridViewColumn item in dgvDetail.Columns)
  684. {
  685. if (!item.Visible)
  686. {
  687. continue;
  688. }
  689. if (item.ReadOnly || this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].ReadOnly)
  690. {
  691. this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].Style.BackColor
  692. = Color.White;
  693. }
  694. else
  695. {
  696. this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].Style.BackColor
  697. = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  698. }
  699. }
  700. }
  701. catch (Exception ex)
  702. {
  703. // 对异常进行共通处理
  704. ExceptionManager.HandleEventException(this.ToString(),
  705. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  706. }
  707. }
  708. /// <summary>
  709. /// 编辑前,控制Cell只读
  710. /// </summary>
  711. /// <param name="sender"></param>
  712. /// <param name="e"></param>
  713. private void dgvDetail_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
  714. {
  715. try
  716. {
  717. }
  718. catch (Exception ex)
  719. {
  720. //_ShowFlag = true;
  721. // 对异常进行共通处理
  722. ExceptionManager.HandleEventException(this.ToString(),
  723. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  724. }
  725. }
  726. /// <summary>
  727. /// 切换模具来源
  728. /// </summary>
  729. /// <param name="sender"></param>
  730. /// <param name="e"></param>
  731. private void rabAuto_CheckedChanged(object sender, EventArgs e)
  732. {
  733. this.pnlAuto.Enabled = this.rabAuto.Checked;
  734. this.pnlBinding.Enabled = this.rabBinding.Checked;
  735. }
  736. /// <summary>
  737. /// 验证模具号
  738. /// </summary>
  739. /// <param name="sender"></param>
  740. /// <param name="e"></param>
  741. private void txtGMouldCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
  742. {
  743. if (this.txtGMouldCode.Text == "" || this.dgvDetail.Rows.Count == 0)
  744. {
  745. return;
  746. }
  747. try
  748. {
  749. string gMouldCode = this.txtGroutingLineCode.Text + "-" + this.txtGMouldCode.DataValue.Value.ToString().PadLeft(3, '0');
  750. DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  751. DataRow[] dr = dtInfo.Select("GroutingMouldCode='" + gMouldCode + "'");
  752. if (dr.Length > 0)
  753. {
  754. MessageBox.Show("存在相同的模具编号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  755. e.Cancel = true;
  756. return;
  757. };
  758. }
  759. catch (Exception ex)
  760. {
  761. //_ShowFlag = true;
  762. // 对异常进行共通处理
  763. ExceptionManager.HandleEventException(this.ToString(),
  764. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  765. }
  766. }
  767. /// <summary>
  768. /// 验证模具条码
  769. /// </summary>
  770. /// <param name="sender"></param>
  771. /// <param name="e"></param>
  772. private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
  773. {
  774. if (e.KeyCode == Keys.Enter)
  775. {
  776. this.btnAddMouldBarcode_Click(null, null);
  777. }
  778. }
  779. /// <summary>
  780. /// 添加模具
  781. /// </summary>
  782. /// <param name="sender"></param>
  783. /// <param name="e"></param>
  784. private void btnAddMouldBarcode_Click(object sender, EventArgs e)
  785. {
  786. if (this.txtGroutingLineCode.Text == string.Empty)
  787. {
  788. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型线编码"), this.Text,
  789. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  790. return;
  791. }
  792. if (this.txtGMouldCode.Text == "")
  793. {
  794. MessageBox.Show("没有设定模具号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  795. this.txtGMouldCode.Focus();
  796. return;
  797. }
  798. string barcode = this.txtBarcode.Text.Trim();
  799. if (barcode == "")
  800. {
  801. MessageBox.Show("没有输入模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  802. this.txtBarcode.Focus();
  803. return;
  804. }
  805. try
  806. {
  807. string gMouldCode = this.txtGroutingLineCode.Text + "-" + this.txtGMouldCode.DataValue.Value.ToString().PadLeft(3, '0');
  808. DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  809. DataRow[] dr = dtInfo.Select("GroutingMouldCode='" + gMouldCode + "'");
  810. if (dr.Length > 0)
  811. {
  812. MessageBox.Show("存在相同的模具编号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  813. this.txtGMouldCode.Focus();
  814. this.txtGMouldCode.SelectAll();
  815. return;
  816. };
  817. dr = dtInfo.Select("MouldBarcode = '" + barcode + "'");
  818. if (dr.Length > 0)
  819. {
  820. MessageBox.Show("存在相同的模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  821. this.txtBarcode.Focus();
  822. this.txtBarcode.SelectAll();
  823. return;
  824. };
  825. if (this._isMessageShow == false)
  826. {
  827. DialogResult msgBoxResult = MessageBox.Show("添加模具后,成型线编码相关信息不予许修改,是否继续。",
  828. this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  829. if (msgBoxResult == DialogResult.No)
  830. {
  831. return;
  832. }
  833. else
  834. {
  835. this.txtBuildingNo.ReadOnly = true;
  836. this.txtFloorNo.ReadOnly = true;
  837. this.txtGroutingLineNo.ReadOnly = true;
  838. }
  839. this._isMessageShow = true;
  840. }
  841. // 验证模具条码状态
  842. ClientRequestEntity cre = new ClientRequestEntity();
  843. cre.NameSpace = "PC_Mould";
  844. cre.Name = "GetMouldData";
  845. cre.Properties["MouldBarcode"] = barcode;
  846. ServiceResultEntity sre = PCModuleProxyNew.Service.HandleRequest(cre);
  847. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0 || sre.Data.Tables[0].Rows.Count == 0)
  848. {
  849. MessageBox.Show("无效模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  850. this.txtBarcode.Focus();
  851. this.txtBarcode.SelectAll();
  852. return;
  853. }
  854. DataRow item = sre.Data.Tables["InfoData"].Rows[0];
  855. int mouldStatus = Convert.ToInt32(item["MouldStatus"]);
  856. if (mouldStatus != 1 && mouldStatus != 3)
  857. {
  858. MessageBox.Show("此模具当前状态为【" + item["MouldStatusName"] + "】,不能添加到成型线。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  859. this.txtBarcode.Focus();
  860. this.txtBarcode.SelectAll();
  861. return;
  862. }
  863. int outputCount = Convert.ToInt32(item["OutputCount"]);
  864. if (outputCount == 1)
  865. {
  866. DataRow r = dtInfo.NewRow();
  867. r["GroutingMouldCode"] = gMouldCode;
  868. r["MouldSource"] = "1";
  869. r["MOULDID"] = item["MOULDID"];
  870. r["MOULDCODE"] = item["MOULDCODE"];
  871. r["MOULDBarcode"] = item["MOULDBarcode"];
  872. r["GOODSID"] = item["GOODSID"];
  873. r["GOODSNAME"] = item["GOODSNAME"];
  874. r["GOODSCODE"] = item["GOODSCODE"];
  875. r["GoodsSpecification"] = item["GoodsSpecification"];
  876. r["GROUTINGCOUNT"] = item["GroutingNums"];
  877. r["StandardGroutingCount"] = item["StandardGroutingNum"];
  878. r["MOULDSTATUS"] = Convert.ToInt32(Constant.GMouldStatus.Normal);
  879. //r["REMARKS"] = "";
  880. r["VALUEFLAG"] = "1";
  881. dtInfo.Rows.Add(r);
  882. }
  883. else
  884. {
  885. // 一模多产时,必须绑定连续成型模具编号。 add by chenxy 2018-10-29
  886. string minGMouldCode = gMouldCode;
  887. int minIndex = Convert.ToInt32(this.txtGMouldCode.DataValue.Value);
  888. string maxGMouldCode = this.txtGroutingLineCode.Text + "-" + (minIndex + outputCount).ToString("000");
  889. DataRow[] grows = dtInfo.Select("GroutingMouldCode>='" + minGMouldCode + "' and GroutingMouldCode<'" + maxGMouldCode + "'");
  890. if (grows.Length > 0)
  891. {
  892. MessageBox.Show("此模具的产出数量为【" + outputCount + "】,当前成型模具编号不能连续添加,不能添加到成型线。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  893. this.txtBarcode.Focus();
  894. this.txtBarcode.SelectAll();
  895. return;
  896. }
  897. //for (int i = 0; i < outputCount; i++)
  898. foreach (DataRow itemOutput in sre.Data.Tables["InfoData"].Rows)
  899. {
  900. DataRow r = dtInfo.NewRow();
  901. r["GroutingMouldCode"] = minGMouldCode;
  902. r["MouldSource"] = "1";
  903. r["MOULDID"] = item["MOULDID"];
  904. r["MOULDCODE"] = item["MOULDCODE"];
  905. r["MOULDBarcode"] = item["MOULDBarcode"];
  906. r["GOODSID"] = item["GOODSID"];
  907. r["GOODSNAME"] = item["GOODSNAME"];
  908. r["GOODSCODE"] = item["GOODSCODE"];
  909. r["GoodsSpecification"] = item["GoodsSpecification"];
  910. r["GROUTINGCOUNT"] = itemOutput["GroutingNum"];
  911. r["MouldOutputNo"] = itemOutput["OutputNo"];
  912. r["StandardGroutingCount"] = item["StandardGroutingNum"];
  913. r["MOULDSTATUS"] = Convert.ToInt32(Constant.GMouldStatus.Normal);
  914. //r["REMARKS"] = "";
  915. r["VALUEFLAG"] = "1";
  916. dtInfo.Rows.Add(r);
  917. minGMouldCode = this.txtGroutingLineCode.Text + "-" + (++minIndex).ToString("000");
  918. }
  919. }
  920. //foreach (DataGridViewRow row in dgvDetail.Rows)
  921. //{
  922. // if (string.IsNullOrEmpty(row.Cells["MouldID"].Value + ""))
  923. // {
  924. // // 自动生成模具
  925. // row.Cells["GroutingCount"].ReadOnly = false;
  926. // row.Cells["StandardGroutingCount"].ReadOnly = false;
  927. // }
  928. // else
  929. // {
  930. // // 模具档案
  931. // row.Cells["GroutingCount"].ReadOnly = true;
  932. // row.Cells["StandardGroutingCount"].ReadOnly = true;
  933. // }
  934. //}
  935. //this.dgvDetail.IsSetInputColumnsColor = true;
  936. //this.txtGMouldCode.DataValue = this.txtGMouldCode.DataValue.Value + 1;
  937. this.txtGMouldCode.DataValue = this.txtGMouldCode.DataValue.Value + outputCount;
  938. this.txtBarcode.Clear();
  939. this.txtBarcode.Focus();
  940. }
  941. catch (Exception ex)
  942. {
  943. //_ShowFlag = true;
  944. // 对异常进行共通处理
  945. ExceptionManager.HandleEventException(this.ToString(),
  946. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  947. }
  948. }
  949. #endregion
  950. #region 私有方法
  951. /// <summary>
  952. /// 将实体数据转换为DataTable,绑定到控件中
  953. /// </summary>
  954. protected DataTable ListToTable()
  955. {
  956. try
  957. {
  958. DataTable dtDataSourse = new DataTable();
  959. dtDataSourse.Columns.Add("GROUTINGMOULDCODE", System.Type.GetType("System.String"));
  960. dtDataSourse.Columns.Add("GOODSNAME", System.Type.GetType("System.String"));
  961. dtDataSourse.Columns.Add("GoodsCode", System.Type.GetType("System.String"));
  962. dtDataSourse.Columns.Add("GoodsSpecification", System.Type.GetType("System.String"));
  963. dtDataSourse.Columns.Add("GOODSID", System.Type.GetType("System.String"));
  964. dtDataSourse.Columns.Add("Remarks", System.Type.GetType("System.String"));
  965. dtDataSourse.Columns.Add("GROUTINGCOUNT", System.Type.GetType("System.String"));
  966. for (int i = 0; i < _addDetailList.Count; i++)
  967. {
  968. DataRow drRow = dtDataSourse.NewRow();
  969. drRow["GROUTINGMOULDCODE"] = _addDetailList[i].GROUTINGMOULDCODE;
  970. drRow["GOODSNAME"] = _addDetailList[i].GOODSNAME;
  971. drRow["GoodsCode"] = _addDetailList[i].GOODSCODE;
  972. drRow["GoodsSpecification"] = _addDetailList[i].GoodsSpecification;
  973. drRow["GOODSID"] = _addDetailList[i].GOODSID;
  974. drRow["Remarks"] = _addDetailList[i].REMARKS;
  975. drRow["GROUTINGCOUNT"] = _addDetailList[i].GROUTINGCOUNT;
  976. dtDataSourse.Rows.Add(drRow);
  977. }
  978. return dtDataSourse;
  979. }
  980. catch (Exception ex)
  981. {
  982. throw ex;
  983. }
  984. }
  985. /// <summary>
  986. /// 验证添加项
  987. /// </summary>
  988. protected int ValidationText()
  989. {
  990. int ErrorId = 0;
  991. string txtBuildingNo = this.txtBuildingNo.Text.Trim();
  992. string txtFloorNo = this.txtFloorNo.Text.Trim();
  993. string txtGroutingLineNo = this.txtGroutingLineNo.Text.Trim();
  994. string txtGroutingLineCode = this.txtGroutingLineCode.Text.Trim();
  995. string txtGroutingLineName = this.txtGroutingLineName.Text.Trim();
  996. string txtRemarks = this.txtRemarks.Text.Trim();
  997. //xuwei add 2021-09-12
  998. string txtWorkShop = this.txtWorkShop.Text.Trim();
  999. //xuwei end
  1000. if (txtBuildingNo == string.Empty)
  1001. {
  1002. ErrorId = 1;
  1003. return ErrorId;
  1004. }
  1005. if (txtFloorNo == string.Empty)
  1006. {
  1007. ErrorId = 2;
  1008. return ErrorId;
  1009. }
  1010. if (txtGroutingLineNo == string.Empty)
  1011. {
  1012. ErrorId = 3;
  1013. return ErrorId;
  1014. }
  1015. if (txtGroutingLineCode == string.Empty)
  1016. {
  1017. ErrorId = 4;
  1018. return ErrorId;
  1019. }
  1020. if (txtGroutingLineName == string.Empty)
  1021. {
  1022. ErrorId = 5;
  1023. return ErrorId;
  1024. }
  1025. //if (dkUser.UserID == null)
  1026. //{
  1027. // ErrorId = 7;
  1028. // return ErrorId;
  1029. //}
  1030. if (scbGMouldType.SearchedPKMember == 0)
  1031. {
  1032. ErrorId = 8;
  1033. return ErrorId;
  1034. }
  1035. //xuwei add 2021-09-12
  1036. if(txtWorkShop == string.Empty)
  1037. {
  1038. ErrorId = 9;
  1039. return ErrorId;
  1040. }
  1041. //xuwei end
  1042. return ErrorId;
  1043. }
  1044. #endregion
  1045. }
  1046. }