F_PC_0102_1_1.cs 37 KB

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