F_PC_0102_1_1.cs 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  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. default:
  322. break;
  323. };
  324. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, errorAddress),
  325. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  326. return;
  327. }
  328. if (LogInUserInfo.CurrentUser.CurrentUserEntity.AccountCode == "imex" &&
  329. this.scbUser1.SearchedValue == null)
  330. {
  331. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型班长"),
  332. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  333. return;
  334. }
  335. // 模具信息可以为空
  336. //DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  337. //if (dtInfo.Rows.Count == Constant.INT_IS_ZERO)
  338. //{
  339. // MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "模具信息"), this.Text,
  340. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  341. // return;
  342. //}
  343. DataTable dtUser = this.dgvUser.DataSource as DataTable;
  344. dtUser.TableName = "dtUser";
  345. dtUser.AcceptChanges();
  346. if (dtUser.Rows.Count == Constant.INT_IS_ZERO)
  347. {
  348. /* 成型线可以不绑定成型工号 chenxy 2019-10-08
  349. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型工号"), this.Text,
  350. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  351. this.tabControl1.SelectTab(0);
  352. return;
  353. */
  354. }
  355. else
  356. {
  357. DataRow[] dr = dtUser.Select("UserName='' or UserName is null");
  358. if (dr.Length > 0)
  359. {
  360. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型工号"), this.Text,
  361. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  362. this.tabControl1.SelectTab(0);
  363. return;
  364. }
  365. }
  366. //更新注浆次数
  367. DataTable dtDetail = this.dgvDetail.DataSource as DataTable;
  368. dtDetail.TableName = "dtDetail";
  369. GroutingLineEntity ginfo = new GroutingLineEntity();
  370. ginfo.BUILDINGNO = this.txtBuildingNo.Text.Trim();
  371. ginfo.FLOORNO = this.txtFloorNo.Text.Trim();
  372. ginfo.GROUTINGLINENO = this.txtGroutingLineNo.Text.Trim();
  373. ginfo.GROUTINGLINECODE = this.txtGroutingLineCode.Text.Trim();
  374. ginfo.GROUTINGLINENAME = this.txtGroutingLineName.Text.Trim();
  375. ginfo.REMARKS = this.txtRemarks.Text.Trim();
  376. //ginfo.USERID = this.dkUser.UserID;
  377. if (dtUser.Rows.Count > 0)
  378. {
  379. ginfo.USERID = Convert.ToInt32(dtUser.Rows[0]["UserID"]);
  380. }
  381. else
  382. {
  383. ginfo.USERID = null;
  384. }
  385. //xuwei add 2019-11-13 高压注浆
  386. ginfo.HIGHPRESSUREFLAG = HighPressureFlag.Checked ? 1 : 0;
  387. ginfo.NON_SAP = chkNonSAP.Checked ? "1" : "0";
  388. //xuwei end
  389. ginfo.MOULDTYPEID = this.scbGMouldType.SearchedPKMember;
  390. ginfo.MouldStatus = Convert.ToInt32(Constant.GMouldStatus.Normal);
  391. ginfo.VALUEFLAG = Convert.ToInt32(Constant.ValueFlag.Effective);
  392. ginfo.MOULDQUANTITY = dtDetail.Rows.Count;//this._addDetailList.Count;
  393. if (this.scbUser1.SearchedValue != null)
  394. {
  395. ginfo.MonitorID = Convert.ToInt32(this.scbUser1.SearchedValue);
  396. ginfo.MonitorCode = this.scbUser1.SearchedItem["Usercode"]+"";
  397. }
  398. this._addDetailUserList.Clear();
  399. //for (int i = 0; i < dtDetail.Rows.Count; i++)
  400. //{
  401. // _addDetailList[i].GROUTINGCOUNT = Convert.ToDecimal(dtDetail.Rows[i]["GROUTINGCOUNT"]);
  402. //}
  403. //foreach (DataRow r in dtUser.Rows)
  404. //{
  405. // GroutingLineUserEntity entity = new GroutingLineUserEntity();
  406. // entity.USERID = Convert.ToInt32(r["USERID"]);
  407. // entity.REMARK = r["REMARK"].ToString();
  408. // this._addDetailUserList.Add(entity);
  409. //}
  410. //DataTable dt = this.dgvDetail.DataSource as DataTable;
  411. //if (dt != null)
  412. //{
  413. // for (int i = 0; i < dt.Rows.Count; i++)
  414. // {
  415. // this._addDetailList[i].REMARKS = dt.Rows[i]["Remarks"].ToString();
  416. // }
  417. //}
  418. ServiceResultEntity myReturn = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
  419. {
  420. //return PCModuleProxy.Service.AddGroutingLine_New(ginfo, this._addDetailList, this._addDetailUserList);
  421. return PCModuleProxy.Service.AddGroutingLine_NewLine(ginfo, dtDetail, dtUser);
  422. }));
  423. if (myReturn != null)
  424. {
  425. if (myReturn.Status == Constant.ServiceResultStatus.Success)
  426. {
  427. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "成型线信息", "保存"),
  428. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  429. this.DialogResult = DialogResult.OK;
  430. }
  431. else if (myReturn.OtherStatus == -50)
  432. {
  433. MessageBox.Show("成型线编码已存在,请重新输入!",
  434. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  435. }
  436. else if (myReturn.OtherStatus == -2)
  437. {
  438. MessageBox.Show(Messages.MSG_CMN_W029,
  439. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  440. }
  441. }
  442. else
  443. {
  444. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "成型线信息", "保存"),
  445. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  446. }
  447. }
  448. catch (Exception ex)
  449. {
  450. // 对异常进行共通处理
  451. ExceptionManager.HandleEventException(this.ToString(),
  452. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  453. }
  454. }
  455. /// <summary>
  456. /// 编号变更
  457. /// </summary>
  458. private void txtBuildingNo_TextChanged(object sender, EventArgs e)
  459. {
  460. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  461. + this.txtGroutingLineNo.Text.Trim();
  462. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  463. + this.txtGroutingLineNo.Text.Trim();
  464. }
  465. /// <summary>
  466. /// 编号变更
  467. /// </summary>
  468. private void txtFloorNo_TextChanged(object sender, EventArgs e)
  469. {
  470. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  471. + this.txtGroutingLineNo.Text.Trim();
  472. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  473. + this.txtGroutingLineNo.Text.Trim();
  474. }
  475. /// <summary>
  476. /// 编号变更
  477. /// </summary>
  478. private void txtGroutingLineNo_TextChanged(object sender, EventArgs e)
  479. {
  480. this.txtGroutingLineCode.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  481. + this.txtGroutingLineNo.Text.Trim();
  482. this.txtGroutingLineName.Text = this.txtBuildingNo.Text + this.txtFloorNo.Text.PadLeft(2, '0')
  483. + this.txtGroutingLineNo.Text.Trim();
  484. }
  485. /// <summary>
  486. /// 成型线文本改变事件
  487. /// </summary>
  488. /// <param name="sender"></param>
  489. /// <param name="e"></param>
  490. private void txtGroutingLineCode_TextChanged(object sender, EventArgs e)
  491. {
  492. if (this._addDetailList.Count != Constant.INT_IS_ZERO)
  493. {
  494. MessageBox.Show("成型线编码变更后,需重新生成模具信息!",
  495. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  496. this._addDetailList.Clear();
  497. this._mouldCount = 0;
  498. this.dgvDetail.DataSource = null;
  499. }
  500. }
  501. /// <summary>
  502. /// 成型工号开始编辑事件
  503. /// </summary>
  504. /// <param name="sender"></param>
  505. /// <param name="e"></param>
  506. private void dgvUser_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
  507. {
  508. try
  509. {
  510. if (this.dgvUser.Rows.Count <= 1)
  511. {
  512. return;
  513. }
  514. DataGridViewColumn columnItem = this.dgvUser.Columns[e.ColumnIndex];
  515. if ("UserCode".Equals(columnItem.Name))
  516. {
  517. _userCodeValue = this.dgvUser.Rows[e.RowIndex].Cells[columnItem.Name].Value + "";
  518. }
  519. }
  520. catch (Exception ex)
  521. {
  522. // 对异常进行共通处理
  523. ExceptionManager.HandleEventException(this.ToString(),
  524. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  525. }
  526. }
  527. /// <summary>
  528. /// 工号单元格值改变事件
  529. /// </summary>
  530. /// <param name="sender"></param>
  531. /// <param name="e"></param>
  532. private void dgvUser_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  533. {
  534. try
  535. {
  536. if (this.dgvUser.Rows.Count <= 1 || !_ShowFlag)
  537. {
  538. return;
  539. }
  540. DataGridViewRow rowItem = this.dgvUser.Rows[e.RowIndex];
  541. DataGridViewColumn columnItem = this.dgvUser.Columns[e.ColumnIndex];
  542. // 用编号获取产品信息
  543. if ("UserCode".Equals(columnItem.Name))
  544. {
  545. _ShowFlag = false;
  546. FormUtility.BindUserRowDataSource(this.dgvUser,
  547. e.RowIndex, columnItem.Name, _userCodeValue);
  548. // 设置可输入单元格的颜色
  549. this.dgvUser.IsSetInputColumnsColor = true;
  550. }
  551. _ShowFlag = true;
  552. }
  553. catch (Exception ex)
  554. {
  555. //_ShowFlag = true;
  556. // 对异常进行共通处理
  557. ExceptionManager.HandleEventException(this.ToString(),
  558. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  559. }
  560. }
  561. /// <summary>
  562. /// 窗体加载事件
  563. /// </summary>
  564. /// <param name="sender"></param>
  565. /// <param name="e"></param>
  566. private void F_PC_0102_1_1_Load(object sender, EventArgs e)
  567. {
  568. // dgvDetail.IsSetInputColumnsColor = true;
  569. //dgvUser.IsSetInputColumnsColor = true;
  570. //窗体加载模具数据源
  571. this.dgvDetail.AutoGenerateColumns = false;
  572. DataTable dtGroutingInfo = new DataTable();
  573. dtGroutingInfo.Columns.Add("MouldSource");
  574. dtGroutingInfo.Columns.Add("MOULDID", typeof(int));
  575. dtGroutingInfo.Columns.Add("MOULDBarcode");
  576. dtGroutingInfo.Columns.Add("MOULDCODE");
  577. dtGroutingInfo.Columns.Add("GOODSID", typeof(int));
  578. dtGroutingInfo.Columns.Add("GOODSNAME");
  579. dtGroutingInfo.Columns.Add("GOODSCODE");
  580. dtGroutingInfo.Columns.Add("GoodsSpecification");
  581. dtGroutingInfo.Columns.Add("GROUTINGCOUNT", typeof(int));
  582. dtGroutingInfo.Columns.Add("StandardGroutingCount", typeof(int));
  583. dtGroutingInfo.Columns.Add("MOULDSTATUS", typeof(int));
  584. dtGroutingInfo.Columns.Add("REMARKS");
  585. dtGroutingInfo.Columns.Add("VALUEFLAG");
  586. dtGroutingInfo.Columns.Add("GroutingMouldCode");
  587. dtGroutingInfo.Columns.Add("MouldOutputNo", typeof(int));
  588. dtGroutingInfo.DefaultView.Sort = "GroutingMouldCode";
  589. dtGroutingInfo.Columns["GroutingMouldCode"].Unique = true;
  590. this.dgvDetail.DataSource = dtGroutingInfo;
  591. DataSet dsSetting = SystemModuleProxy.Service.GetSystemSettingDataByCode(Constant.SettingType.S_PC_001.ToString());
  592. if (dsSetting != null && dsSetting.Tables[0].Rows.Count > 0)
  593. {
  594. string flag = dsSetting.Tables[0].Rows[0]["SettingValue"].ToString();
  595. if (flag == "2")
  596. {
  597. this.rabBinding.Checked = true;
  598. this.rabAuto.Enabled = false;
  599. }
  600. else if (flag == "1")
  601. {
  602. this.rabBinding.Checked = true;
  603. }
  604. else
  605. {
  606. this.rabAuto.Checked = true;
  607. }
  608. }
  609. }
  610. /// <summary>
  611. /// 窗体加载后显示事件
  612. /// </summary>
  613. /// <param name="sender"></param>
  614. /// <param name="e"></param>
  615. private void F_PC_0102_1_1_Shown(object sender, EventArgs e)
  616. {
  617. //dgvDetail.IsSetInputColumnsColor = true;
  618. dgvUser.IsSetInputColumnsColor = true;
  619. }
  620. /// <summary>
  621. /// 工号排序事件
  622. /// </summary>
  623. /// <param name="sender"></param>
  624. /// <param name="e"></param>
  625. private void dgvUser_Sorted(object sender, EventArgs e)
  626. {
  627. this.dgvUser.IsSetInputColumnsColor = true;
  628. }
  629. /// <summary>
  630. /// 窗口切换事件
  631. /// </summary>
  632. /// <param name="sender"></param>
  633. /// <param name="e"></param>
  634. private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
  635. {
  636. //dgvDetail.IsSetInputColumnsColor = true;
  637. this.dgvUser.IsSetInputColumnsColor = true;
  638. }
  639. /// <summary>
  640. /// 行绘制前,控制Cell只读
  641. /// </summary>
  642. /// <param name="sender"></param>
  643. /// <param name="e"></param>
  644. private void dgvDetail_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
  645. {
  646. if (this.dgvDetail.ReadOnly || e.RowIndex < 0)
  647. {
  648. return;
  649. }
  650. try
  651. {
  652. if (string.IsNullOrEmpty(dgvDetail.Rows[e.RowIndex].Cells["MouldID"].Value + ""))
  653. {
  654. // 自动生成模具
  655. this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].ReadOnly = false;
  656. this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].ReadOnly = false;
  657. //this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].Style.BackColor
  658. // = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  659. //this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].Style.BackColor
  660. // = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  661. }
  662. else
  663. {
  664. // 模具档案
  665. this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].ReadOnly = true;
  666. this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].ReadOnly = true;
  667. //this.dgvDetail.Rows[e.RowIndex].Cells["GroutingCount"].Style.BackColor
  668. // = Color.White;
  669. //this.dgvDetail.Rows[e.RowIndex].Cells["StandardGroutingCount"].Style.BackColor
  670. //= Color.White;
  671. }
  672. foreach (DataGridViewColumn item in dgvDetail.Columns)
  673. {
  674. if (!item.Visible)
  675. {
  676. continue;
  677. }
  678. if (item.ReadOnly || this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].ReadOnly)
  679. {
  680. this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].Style.BackColor
  681. = Color.White;
  682. }
  683. else
  684. {
  685. this.dgvDetail.Rows[e.RowIndex].Cells[item.Index].Style.BackColor
  686. = ColorTranslator.FromHtml(ControlsConst.ALLOW_MODIFY_AREA_BACKGROUND_COLOR);
  687. }
  688. }
  689. }
  690. catch (Exception ex)
  691. {
  692. // 对异常进行共通处理
  693. ExceptionManager.HandleEventException(this.ToString(),
  694. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  695. }
  696. }
  697. /// <summary>
  698. /// 编辑前,控制Cell只读
  699. /// </summary>
  700. /// <param name="sender"></param>
  701. /// <param name="e"></param>
  702. private void dgvDetail_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
  703. {
  704. try
  705. {
  706. }
  707. catch (Exception ex)
  708. {
  709. //_ShowFlag = true;
  710. // 对异常进行共通处理
  711. ExceptionManager.HandleEventException(this.ToString(),
  712. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  713. }
  714. }
  715. /// <summary>
  716. /// 切换模具来源
  717. /// </summary>
  718. /// <param name="sender"></param>
  719. /// <param name="e"></param>
  720. private void rabAuto_CheckedChanged(object sender, EventArgs e)
  721. {
  722. this.pnlAuto.Enabled = this.rabAuto.Checked;
  723. this.pnlBinding.Enabled = this.rabBinding.Checked;
  724. }
  725. /// <summary>
  726. /// 验证模具号
  727. /// </summary>
  728. /// <param name="sender"></param>
  729. /// <param name="e"></param>
  730. private void txtGMouldCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
  731. {
  732. if (this.txtGMouldCode.Text == "" || this.dgvDetail.Rows.Count == 0)
  733. {
  734. return;
  735. }
  736. try
  737. {
  738. string gMouldCode = this.txtGroutingLineCode.Text + "-" + this.txtGMouldCode.DataValue.Value.ToString().PadLeft(3, '0');
  739. DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  740. DataRow[] dr = dtInfo.Select("GroutingMouldCode='" + gMouldCode + "'");
  741. if (dr.Length > 0)
  742. {
  743. MessageBox.Show("存在相同的模具编号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  744. e.Cancel = true;
  745. return;
  746. };
  747. }
  748. catch (Exception ex)
  749. {
  750. //_ShowFlag = true;
  751. // 对异常进行共通处理
  752. ExceptionManager.HandleEventException(this.ToString(),
  753. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  754. }
  755. }
  756. /// <summary>
  757. /// 验证模具条码
  758. /// </summary>
  759. /// <param name="sender"></param>
  760. /// <param name="e"></param>
  761. private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
  762. {
  763. if (e.KeyCode == Keys.Enter)
  764. {
  765. this.btnAddMouldBarcode_Click(null, null);
  766. }
  767. }
  768. /// <summary>
  769. /// 添加模具
  770. /// </summary>
  771. /// <param name="sender"></param>
  772. /// <param name="e"></param>
  773. private void btnAddMouldBarcode_Click(object sender, EventArgs e)
  774. {
  775. if (this.txtGroutingLineCode.Text == string.Empty)
  776. {
  777. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型线编码"), this.Text,
  778. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  779. return;
  780. }
  781. if (this.txtGMouldCode.Text == "")
  782. {
  783. MessageBox.Show("没有设定模具号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  784. this.txtGMouldCode.Focus();
  785. return;
  786. }
  787. string barcode = this.txtBarcode.Text.Trim();
  788. if (barcode == "")
  789. {
  790. MessageBox.Show("没有输入模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  791. this.txtBarcode.Focus();
  792. return;
  793. }
  794. try
  795. {
  796. string gMouldCode = this.txtGroutingLineCode.Text + "-" + this.txtGMouldCode.DataValue.Value.ToString().PadLeft(3, '0');
  797. DataTable dtInfo = this.dgvDetail.DataSource as DataTable;
  798. DataRow[] dr = dtInfo.Select("GroutingMouldCode='" + gMouldCode + "'");
  799. if (dr.Length > 0)
  800. {
  801. MessageBox.Show("存在相同的模具编号", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  802. this.txtGMouldCode.Focus();
  803. this.txtGMouldCode.SelectAll();
  804. return;
  805. };
  806. dr = dtInfo.Select("MouldBarcode = '" + barcode + "'");
  807. if (dr.Length > 0)
  808. {
  809. MessageBox.Show("存在相同的模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  810. this.txtBarcode.Focus();
  811. this.txtBarcode.SelectAll();
  812. return;
  813. };
  814. if (this._isMessageShow == false)
  815. {
  816. DialogResult msgBoxResult = MessageBox.Show("添加模具后,成型线编码相关信息不予许修改,是否继续。",
  817. this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  818. if (msgBoxResult == DialogResult.No)
  819. {
  820. return;
  821. }
  822. else
  823. {
  824. this.txtBuildingNo.ReadOnly = true;
  825. this.txtFloorNo.ReadOnly = true;
  826. this.txtGroutingLineNo.ReadOnly = true;
  827. }
  828. this._isMessageShow = true;
  829. }
  830. // 验证模具条码状态
  831. ClientRequestEntity cre = new ClientRequestEntity();
  832. cre.NameSpace = "PC_Mould";
  833. cre.Name = "GetMouldData";
  834. cre.Properties["MouldBarcode"] = barcode;
  835. ServiceResultEntity sre = PCModuleProxyNew.Service.HandleRequest(cre);
  836. if (sre == null || sre.Data == null || sre.Data.Tables.Count == 0 || sre.Data.Tables[0].Rows.Count == 0)
  837. {
  838. MessageBox.Show("无效模具条码", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  839. this.txtBarcode.Focus();
  840. this.txtBarcode.SelectAll();
  841. return;
  842. }
  843. DataRow item = sre.Data.Tables["InfoData"].Rows[0];
  844. int mouldStatus = Convert.ToInt32(item["MouldStatus"]);
  845. if (mouldStatus != 1 && mouldStatus != 3)
  846. {
  847. MessageBox.Show("此模具当前状态为【" + item["MouldStatusName"] + "】,不能添加到成型线。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  848. this.txtBarcode.Focus();
  849. this.txtBarcode.SelectAll();
  850. return;
  851. }
  852. int outputCount = Convert.ToInt32(item["OutputCount"]);
  853. if (outputCount == 1)
  854. {
  855. DataRow r = dtInfo.NewRow();
  856. r["GroutingMouldCode"] = gMouldCode;
  857. r["MouldSource"] = "1";
  858. r["MOULDID"] = item["MOULDID"];
  859. r["MOULDCODE"] = item["MOULDCODE"];
  860. r["MOULDBarcode"] = item["MOULDBarcode"];
  861. r["GOODSID"] = item["GOODSID"];
  862. r["GOODSNAME"] = item["GOODSNAME"];
  863. r["GOODSCODE"] = item["GOODSCODE"];
  864. r["GoodsSpecification"] = item["GoodsSpecification"];
  865. r["GROUTINGCOUNT"] = item["GroutingNums"];
  866. r["StandardGroutingCount"] = item["StandardGroutingNum"];
  867. r["MOULDSTATUS"] = Convert.ToInt32(Constant.GMouldStatus.Normal);
  868. //r["REMARKS"] = "";
  869. r["VALUEFLAG"] = "1";
  870. dtInfo.Rows.Add(r);
  871. }
  872. else
  873. {
  874. // 一模多产时,必须绑定连续成型模具编号。 add by chenxy 2018-10-29
  875. string minGMouldCode = gMouldCode;
  876. int minIndex = Convert.ToInt32(this.txtGMouldCode.DataValue.Value);
  877. string maxGMouldCode = this.txtGroutingLineCode.Text + "-" + (minIndex + outputCount).ToString("000");
  878. DataRow[] grows = dtInfo.Select("GroutingMouldCode>='" + minGMouldCode + "' and GroutingMouldCode<'" + maxGMouldCode + "'");
  879. if (grows.Length > 0)
  880. {
  881. MessageBox.Show("此模具的产出数量为【" + outputCount + "】,当前成型模具编号不能连续添加,不能添加到成型线。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  882. this.txtBarcode.Focus();
  883. this.txtBarcode.SelectAll();
  884. return;
  885. }
  886. //for (int i = 0; i < outputCount; i++)
  887. foreach (DataRow itemOutput in sre.Data.Tables["InfoData"].Rows)
  888. {
  889. DataRow r = dtInfo.NewRow();
  890. r["GroutingMouldCode"] = minGMouldCode;
  891. r["MouldSource"] = "1";
  892. r["MOULDID"] = item["MOULDID"];
  893. r["MOULDCODE"] = item["MOULDCODE"];
  894. r["MOULDBarcode"] = item["MOULDBarcode"];
  895. r["GOODSID"] = item["GOODSID"];
  896. r["GOODSNAME"] = item["GOODSNAME"];
  897. r["GOODSCODE"] = item["GOODSCODE"];
  898. r["GoodsSpecification"] = item["GoodsSpecification"];
  899. r["GROUTINGCOUNT"] = itemOutput["GroutingNum"];
  900. r["MouldOutputNo"] = itemOutput["OutputNo"];
  901. r["StandardGroutingCount"] = item["StandardGroutingNum"];
  902. r["MOULDSTATUS"] = Convert.ToInt32(Constant.GMouldStatus.Normal);
  903. //r["REMARKS"] = "";
  904. r["VALUEFLAG"] = "1";
  905. dtInfo.Rows.Add(r);
  906. minGMouldCode = this.txtGroutingLineCode.Text + "-" + (++minIndex).ToString("000");
  907. }
  908. }
  909. //foreach (DataGridViewRow row in dgvDetail.Rows)
  910. //{
  911. // if (string.IsNullOrEmpty(row.Cells["MouldID"].Value + ""))
  912. // {
  913. // // 自动生成模具
  914. // row.Cells["GroutingCount"].ReadOnly = false;
  915. // row.Cells["StandardGroutingCount"].ReadOnly = false;
  916. // }
  917. // else
  918. // {
  919. // // 模具档案
  920. // row.Cells["GroutingCount"].ReadOnly = true;
  921. // row.Cells["StandardGroutingCount"].ReadOnly = true;
  922. // }
  923. //}
  924. //this.dgvDetail.IsSetInputColumnsColor = true;
  925. //this.txtGMouldCode.DataValue = this.txtGMouldCode.DataValue.Value + 1;
  926. this.txtGMouldCode.DataValue = this.txtGMouldCode.DataValue.Value + outputCount;
  927. this.txtBarcode.Clear();
  928. this.txtBarcode.Focus();
  929. }
  930. catch (Exception ex)
  931. {
  932. //_ShowFlag = true;
  933. // 对异常进行共通处理
  934. ExceptionManager.HandleEventException(this.ToString(),
  935. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  936. }
  937. }
  938. #endregion
  939. #region 私有方法
  940. /// <summary>
  941. /// 将实体数据转换为DataTable,绑定到控件中
  942. /// </summary>
  943. protected DataTable ListToTable()
  944. {
  945. try
  946. {
  947. DataTable dtDataSourse = new DataTable();
  948. dtDataSourse.Columns.Add("GROUTINGMOULDCODE", System.Type.GetType("System.String"));
  949. dtDataSourse.Columns.Add("GOODSNAME", System.Type.GetType("System.String"));
  950. dtDataSourse.Columns.Add("GoodsCode", System.Type.GetType("System.String"));
  951. dtDataSourse.Columns.Add("GoodsSpecification", System.Type.GetType("System.String"));
  952. dtDataSourse.Columns.Add("GOODSID", System.Type.GetType("System.String"));
  953. dtDataSourse.Columns.Add("Remarks", System.Type.GetType("System.String"));
  954. dtDataSourse.Columns.Add("GROUTINGCOUNT", System.Type.GetType("System.String"));
  955. for (int i = 0; i < _addDetailList.Count; i++)
  956. {
  957. DataRow drRow = dtDataSourse.NewRow();
  958. drRow["GROUTINGMOULDCODE"] = _addDetailList[i].GROUTINGMOULDCODE;
  959. drRow["GOODSNAME"] = _addDetailList[i].GOODSNAME;
  960. drRow["GoodsCode"] = _addDetailList[i].GOODSCODE;
  961. drRow["GoodsSpecification"] = _addDetailList[i].GoodsSpecification;
  962. drRow["GOODSID"] = _addDetailList[i].GOODSID;
  963. drRow["Remarks"] = _addDetailList[i].REMARKS;
  964. drRow["GROUTINGCOUNT"] = _addDetailList[i].GROUTINGCOUNT;
  965. dtDataSourse.Rows.Add(drRow);
  966. }
  967. return dtDataSourse;
  968. }
  969. catch (Exception ex)
  970. {
  971. throw ex;
  972. }
  973. }
  974. /// <summary>
  975. /// 验证添加项
  976. /// </summary>
  977. protected int ValidationText()
  978. {
  979. int ErrorId = 0;
  980. string txtBuildingNo = this.txtBuildingNo.Text.Trim();
  981. string txtFloorNo = this.txtFloorNo.Text.Trim();
  982. string txtGroutingLineNo = this.txtGroutingLineNo.Text.Trim();
  983. string txtGroutingLineCode = this.txtGroutingLineCode.Text.Trim();
  984. string txtGroutingLineName = this.txtGroutingLineName.Text.Trim();
  985. string txtRemarks = this.txtRemarks.Text.Trim();
  986. if (txtBuildingNo == string.Empty)
  987. {
  988. ErrorId = 1;
  989. return ErrorId;
  990. }
  991. if (txtFloorNo == string.Empty)
  992. {
  993. ErrorId = 2;
  994. return ErrorId;
  995. }
  996. if (txtGroutingLineNo == string.Empty)
  997. {
  998. ErrorId = 3;
  999. return ErrorId;
  1000. }
  1001. if (txtGroutingLineCode == string.Empty)
  1002. {
  1003. ErrorId = 4;
  1004. return ErrorId;
  1005. }
  1006. if (txtGroutingLineName == string.Empty)
  1007. {
  1008. ErrorId = 5;
  1009. return ErrorId;
  1010. }
  1011. //if (dkUser.UserID == null)
  1012. //{
  1013. // ErrorId = 7;
  1014. // return ErrorId;
  1015. //}
  1016. if (scbGMouldType.SearchedPKMember == 0)
  1017. {
  1018. ErrorId = 8;
  1019. return ErrorId;
  1020. }
  1021. return ErrorId;
  1022. }
  1023. #endregion
  1024. }
  1025. }