F_PC_0102_1_1.cs 36 KB

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