F_PC_0102_1_1.cs 37 KB

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