F_PC_0102_1_1.cs 37 KB

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