F_PM_1602.cs 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_1602.cs
  5. * 2.功能描述:新增/编辑半检数据
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2014/12/4 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Text;
  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.WCF.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.Proxys;
  20. using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
  21. using Dongke.IBOSS.PRD.WCF.Proxys.SystemModuleService;
  22. namespace Dongke.IBOSS.PRD.Client.PMModule
  23. {
  24. /// <summary>
  25. /// 新增/编辑半检数据
  26. /// </summary>
  27. public partial class F_PM_1602 : FormBase
  28. {
  29. #region 成员变量
  30. // 半检数据ID
  31. int _semiTestID = -1;
  32. // 过滤数 用来过滤产品对应的缺陷
  33. int _filterCount = 0;
  34. // 当前过滤数
  35. int _currentfilterCount = 0;
  36. // 默认检验明细数据源
  37. private DataSet _dsSemiTestDetail = null;
  38. // 默认缺陷明细数据源
  39. private DataSet _dsSemiTestDefecDetail = null;
  40. // 临时表名
  41. private string _TableName = "Temp";
  42. // 时间戳
  43. private DateTime _OPTimeStamp;
  44. // 操作工号权限
  45. private string _userPurviews = "";
  46. // 编辑行
  47. int editRow = 0;
  48. #endregion
  49. #region 属性
  50. /// <summary>
  51. /// 默认检验明细数据源
  52. /// </summary>
  53. public DataSet DSTableSemiTestDetail
  54. {
  55. set
  56. {
  57. _dsSemiTestDetail = value;
  58. }
  59. get
  60. {
  61. if (_dsSemiTestDetail == null)
  62. {
  63. _dsSemiTestDetail = new DataSet();
  64. return _dsSemiTestDetail;
  65. }
  66. else
  67. {
  68. return _dsSemiTestDetail;
  69. }
  70. }
  71. }
  72. /// <summary>
  73. /// 默认缺陷明细数据源
  74. /// </summary>
  75. public DataSet DSTableSemiTestDefectDetail
  76. {
  77. set
  78. {
  79. _dsSemiTestDefecDetail = value;
  80. }
  81. get
  82. {
  83. if (_dsSemiTestDefecDetail == null)
  84. {
  85. _dsSemiTestDefecDetail = new DataSet();
  86. return _dsSemiTestDefecDetail;
  87. }
  88. else
  89. {
  90. return _dsSemiTestDefecDetail;
  91. }
  92. }
  93. }
  94. #endregion
  95. #region 构造函数
  96. public F_PM_1602()
  97. {
  98. InitializeComponent();
  99. this.btnSave.Text = ButtonText.BTN_SAVE;
  100. this.btnCancel.Text = ButtonText.BTN_CANCEL;
  101. this.Text = FormTitles.F_PM_1602_ADD;
  102. }
  103. public F_PM_1602(int semiTestID)
  104. {
  105. InitializeComponent();
  106. this._semiTestID = semiTestID;
  107. this.btnSave.Text = ButtonText.BTN_SAVE;
  108. this.btnCancel.Text = ButtonText.BTN_CANCEL;
  109. this.Text = FormTitles.F_PM_1602_EDIT;
  110. }
  111. #endregion
  112. #region 事件
  113. // 页面窗体加载事件
  114. private void F_PM_1602_Load(object sender, EventArgs e)
  115. {
  116. try
  117. {
  118. this.dgvSemiTestDetail.IsSetInputColumnsColor = true;
  119. this.dgvDefectDetail.IsSetInputColumnsColor = true;
  120. // 加载权限
  121. FormPermissionManager.FormPermissionControl(this.Name, this,
  122. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  123. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  124. this.dgvSemiTestDetail.AutoGenerateColumns = false; //半检明细
  125. this.dgvDefectDetail.AutoGenerateColumns = false; //缺陷明细
  126. this.dgvSemiTestDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
  127. this.dgvDefectDetail.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
  128. if (DSTableSemiTestDetail.Tables.IndexOf(_TableName + _filterCount) == -Constant.INT_IS_ONE)
  129. {
  130. DataTable dtSemiTestDetail = new DataTable(_TableName + _filterCount);
  131. dtSemiTestDetail.Columns.Add("GroutingUserCode");
  132. dtSemiTestDetail.Columns.Add("GroutingUserID", typeof(decimal));
  133. dtSemiTestDetail.Columns.Add("GoodsID", typeof(decimal));
  134. dtSemiTestDetail.Columns.Add("GoodsCode");
  135. dtSemiTestDetail.Columns.Add("GoodsName");
  136. dtSemiTestDetail.Columns.Add("GoodsSpecification");
  137. dtSemiTestDetail.Columns.Add("GoodsModel");
  138. dtSemiTestDetail.Columns.Add("GoodsTypeName");
  139. dtSemiTestDetail.Columns.Add("TestNum");
  140. dtSemiTestDetail.Columns.Add("ScrapNum");
  141. dtSemiTestDetail.Columns.Add("ScrapReason");
  142. dtSemiTestDetail.Columns.Add("Feedback");
  143. dtSemiTestDetail.Columns.Add("FilterCount");
  144. DSTableSemiTestDetail.Tables.Add(dtSemiTestDetail);
  145. }
  146. if (DSTableSemiTestDefectDetail.Tables.IndexOf(_TableName + _filterCount) == -Constant.INT_IS_ONE)
  147. {
  148. DataTable dtSemiTestDefectDetail = new DataTable(_TableName + _filterCount);
  149. dtSemiTestDefectDetail.Columns.Add("DefectID", typeof(decimal));
  150. dtSemiTestDefectDetail.Columns.Add("DefectPositionID", typeof(decimal));
  151. dtSemiTestDefectDetail.Columns.Add("DefectNum");
  152. dtSemiTestDefectDetail.Columns.Add("FilterCount");
  153. DSTableSemiTestDefectDetail.Tables.Add(dtSemiTestDefectDetail);
  154. }
  155. this.dgvSemiTestDetail.DataSource = DSTableSemiTestDetail.Tables[_TableName + _filterCount];
  156. this.dgvDefectDetail.DataSource = DSTableSemiTestDefectDetail.Tables[_TableName + _filterCount];
  157. //设置操作工号数据源
  158. getPurview();//
  159. // 获取检验工号数据源
  160. SUserEntity userEntity = new SUserEntity();
  161. userEntity.IsWorker = 1;//生产工号
  162. DataSet dsUser = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  163. {
  164. return SystemModuleProxy.Service.SearchUserData(userEntity);
  165. }));
  166. if (dsUser != null && dsUser.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  167. {
  168. //this.dropUserID.DisplayMember = "UserCode";
  169. //this.dropUserID.ValueMember = "UserID";
  170. //this.dropUserID.DataSource = dsUser.Tables[0];
  171. //this.GroutingUserID.DisplayMember = "UserCode";
  172. //this.GroutingUserID.ValueMember = "UserID";
  173. //this.GroutingUserID.DataSource = dsUser.Tables[0];
  174. if (this._userPurviews != string.Empty)
  175. {
  176. this.dropUserID.DisplayMember = "UserCode";
  177. this.dropUserID.ValueMember = "UserID";
  178. DataView dvUser = dsUser.Tables[0].DefaultView;
  179. dvUser.RowFilter = "UserID in(" + this._userPurviews + ")";
  180. DataTable dt = dvUser.ToTable();
  181. DataRow dr = dt.NewRow();
  182. dr["UserID"] = -1;
  183. dr["UserCode"] = "";
  184. dt.Rows.InsertAt(dr, 0);
  185. this.dropUserID.DataSource = dt;
  186. // 设置成检工号数据源
  187. this.GroutingUserID.DisplayMember = "UserCode";
  188. this.GroutingUserID.ValueMember = "UserID";
  189. this.GroutingUserID.DataSource = dt;
  190. }
  191. }
  192. // 获取产品档案
  193. GoodsEntity goodsEntity = new GoodsEntity();
  194. goodsEntity.ValueFlag = 1;//有效标记
  195. DataSet dsGoods = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  196. {
  197. return SystemModuleProxy.Service.SerachGoods(goodsEntity);
  198. }));
  199. if (dsGoods != null && dsGoods.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  200. {
  201. // 设置产品数据源
  202. this.GoodsID.DisplayMember = "GoodsCode";
  203. this.GoodsID.ValueMember = "GoodsID";
  204. this.GoodsID.DataSource = dsGoods.Tables[0];
  205. }
  206. // 获取缺陷
  207. DataSet dsDefect = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  208. {
  209. return SystemModuleProxy.Service.GetDictionaryData(0, "TPC005");
  210. }));
  211. if (dsDefect != null && dsDefect.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  212. {
  213. this.DefectID.DisplayMember = "DictionaryValue";
  214. this.DefectID.ValueMember = "DictionaryID";
  215. this.DefectID.DataSource = dsDefect.Tables[0];
  216. }
  217. // 获取缺陷位置
  218. DataSet dsDefectPosition = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  219. {
  220. return SystemModuleProxy.Service.GetDictionaryData(0, "TPC006");
  221. }));
  222. if (dsDefectPosition != null && dsDefectPosition.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  223. {
  224. this.DefectPositionID.DisplayMember = "DictionaryValue";
  225. this.DefectPositionID.ValueMember = "DictionaryID";
  226. this.DefectPositionID.DataSource = dsDefectPosition.Tables[0];
  227. }
  228. // 获取半检类别
  229. DataSet dsType = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  230. {
  231. return SystemModuleProxy.Service.GetDictionaryData(0, "TPC007");
  232. }));
  233. if (dsType != null && dsType.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  234. {
  235. this.dropSemiTestType.DisplayMember = "DictionaryValue";
  236. this.dropSemiTestType.ValueMember = "DictionaryID";
  237. this.dropSemiTestType.DataSource = dsType.Tables[0];
  238. }
  239. this.dtpDate.Value = DateTime.Now; //设置检验日期,默认当天
  240. if (this._semiTestID > Constant.INT_IS_ZERO) // 编辑数据
  241. {
  242. SetEditDataSource();
  243. }
  244. }
  245. catch (Exception ex)
  246. {
  247. // 对异常进行共通处理
  248. ExceptionManager.HandleEventException(this.ToString(),
  249. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  250. }
  251. }
  252. //添加行事件
  253. private void dgvSemiTestDetail_UserAddedRow(object sender, DataGridViewRowEventArgs e)
  254. {
  255. string UpFilterCount = "";
  256. if (this.dgvSemiTestDetail.Rows[e.Row.Index - 1].Cells["FilterCount"].Value != null
  257. && this.dgvSemiTestDetail.Rows[e.Row.Index - 1].Cells["FilterCount"].Value.ToString() != string.Empty)
  258. {
  259. UpFilterCount = this.dgvSemiTestDetail.Rows[e.Row.Index - 1].Cells["FilterCount"].Value.ToString();
  260. }
  261. if (UpFilterCount == string.Empty)
  262. {
  263. this.dgvSemiTestDetail.Rows[e.Row.Index - 1].Cells["FilterCount"].Value = this._filterCount.ToString();
  264. }
  265. this._filterCount = this._filterCount + 1;
  266. this.dgvSemiTestDetail.Rows[e.Row.Index].Cells["FilterCount"].Value = this._filterCount.ToString();
  267. this._currentfilterCount = this._filterCount;
  268. // 添加时把对应只读去掉,防止上来先选择缺陷
  269. this.dgvDefectDetail.ReadOnly = false;
  270. dgvSemiTestDetail_SelectionChanged(sender, e);
  271. }
  272. /// <summary>
  273. /// 保存按钮事件
  274. /// </summary>
  275. /// <param name="sender"></param>
  276. /// <param name="e"></param>
  277. private void btnSave_Click(object sender, EventArgs e)
  278. {
  279. try
  280. {
  281. if (this.dropUserID.SelectedValue == null || this.dropUserID.SelectedValue.ToString() == "-1")
  282. {
  283. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "检验工号"),
  284. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  285. return;
  286. }
  287. if (this.dropSemiTestType.SelectedValue == null
  288. || this.dropSemiTestType.SelectedValue.ToString() == string.Empty)
  289. {
  290. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "半检类别"),
  291. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  292. return;
  293. }
  294. if (this._semiTestID > Constant.INT_IS_ZERO)
  295. {
  296. int ValidateRow = (int)DoAsync(new BaseAsyncMethod(() =>
  297. {
  298. return PMModuleProxy.Service.ValidateOPTimeStamp(this._semiTestID, _OPTimeStamp);
  299. }));
  300. if (ValidateRow == Constant.INT_IS_NEGATIE_ONE)
  301. {
  302. // 提示信息
  303. MessageBox.Show(string.Format(Messages.MSG_CMN_W012, "编辑半检", "保存"),
  304. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  305. return;
  306. }
  307. }
  308. SemiTestEntity[] semiTestEntitys = new SemiTestEntity[1];
  309. SemiTestEntity semiTestEntity = new SemiTestEntity();
  310. semiTestEntity.TestUserID = Convert.ToInt32(this.dropUserID.SelectedValue);
  311. semiTestEntity.TestDate = this.dtpDate.Value;
  312. semiTestEntity.Remarks = this.txtRemarks.Text.Trim();
  313. semiTestEntity.AuditStatus = 0;
  314. semiTestEntity.ValueFlag = 1;
  315. semiTestEntity.SemiTestType = Convert.ToInt32(this.dropSemiTestType.SelectedValue);
  316. semiTestEntitys[0] = semiTestEntity;
  317. bool isError = false; // 是否存在错误
  318. int ErrorType = -1; // 默认-1 明细1 缺陷2
  319. int CurrentRowIndex = -1; //错误行号
  320. int DetailCurrentRowIndex = -1; //错误行号
  321. int FilterCount = -1;
  322. List<SemiTestDetailEntity> semiTestDetailEntitys = new List<SemiTestDetailEntity>();
  323. SemiTestDetailEntity semiTestDetailEntity = null;
  324. for (int i = 0; i < this.DSTableSemiTestDetail.Tables[0].Rows.Count; i++) //半检明细表
  325. {
  326. semiTestDetailEntity = new SemiTestDetailEntity();
  327. if (this.DSTableSemiTestDetail.Tables[0].Rows[i]["GroutingUserID"].ToString() == string.Empty)
  328. {
  329. isError = true;//有错误 未选择成型工号
  330. ErrorType = 1; //明细
  331. CurrentRowIndex = i;
  332. break;
  333. }
  334. semiTestDetailEntity.GroutingUserID = Convert.ToInt32(this.DSTableSemiTestDetail.Tables[0].Rows[i]["GroutingUserID"]);
  335. if (this.DSTableSemiTestDetail.Tables[0].Rows[i]["GoodsCode"].ToString() == string.Empty)
  336. {
  337. isError = true;//有错误 未选择产品ID
  338. ErrorType = 1; //明细
  339. CurrentRowIndex = i;
  340. break;
  341. }
  342. semiTestDetailEntity.GoodsID = Convert.ToInt32(this.DSTableSemiTestDetail.Tables[0].Rows[i]["GoodsID"]);
  343. semiTestDetailEntity.GoodsCode = this.DSTableSemiTestDetail.Tables[0].Rows[i]["GoodsCode"].ToString();
  344. semiTestDetailEntity.GoodsName = this.DSTableSemiTestDetail.Tables[0].Rows[i]["GoodsName"].ToString();
  345. semiTestDetailEntity.TestNum = this.DSTableSemiTestDetail.Tables[0].Rows[i]["TestNum"].ToString() == string.Empty ? 0 :
  346. Convert.ToInt32(this.DSTableSemiTestDetail.Tables[0].Rows[i]["TestNum"]);
  347. semiTestDetailEntity.ScrapNum = this.DSTableSemiTestDetail.Tables[0].Rows[i]["ScrapNum"].ToString() == string.Empty ? 0 :
  348. Convert.ToInt32(this.DSTableSemiTestDetail.Tables[0].Rows[i]["ScrapNum"]);
  349. semiTestDetailEntity.ScrapReason = this.DSTableSemiTestDetail.Tables[0].Rows[i]["ScrapReason"].ToString();
  350. semiTestDetailEntity.Feedback = this.DSTableSemiTestDetail.Tables[0].Rows[i]["Feedback"].ToString();
  351. semiTestDetailEntity.ValueFlag = 1;
  352. // 遍历产品对应的缺陷
  353. List<SemiTestDefectEntity> semiTestDefectEntitys = new List<SemiTestDefectEntity>();
  354. if (this.DSTableSemiTestDefectDetail.Tables.Contains(string.Format("{0}{1}", this._TableName,
  355. this.DSTableSemiTestDetail.Tables[0].Rows[i]["FilterCount"].ToString())))
  356. {
  357. SemiTestDefectEntity semiTestDefectEntity = null;
  358. DataTable dtTemp = this.DSTableSemiTestDefectDetail.Tables[string.Format("{0}{1}", this._TableName,
  359. this.DSTableSemiTestDetail.Tables[0].Rows[i]["FilterCount"].ToString())];
  360. int Row = 0;
  361. foreach (DataRow drStaff in dtTemp.Rows)
  362. {
  363. semiTestDefectEntity = new SemiTestDefectEntity();
  364. if (drStaff["DefectID"] == null || drStaff["DefectID"].ToString() == string.Empty)
  365. {
  366. isError = true;//有错误 缺陷ID
  367. ErrorType = 2; //缺陷明细
  368. CurrentRowIndex = Row;
  369. DetailCurrentRowIndex = i;
  370. FilterCount = Convert.ToInt32(drStaff["FilterCount"].ToString());
  371. break;
  372. }
  373. semiTestDefectEntity.DefectID = Convert.ToInt32(drStaff["DefectID"]);
  374. if (drStaff["DefectPositionID"] == null || drStaff["DefectPositionID"].ToString() == string.Empty)
  375. {
  376. isError = true;//有错误 缺陷位置ID
  377. ErrorType = 2; //缺陷明细
  378. CurrentRowIndex = Row;
  379. DetailCurrentRowIndex = i;
  380. FilterCount = Convert.ToInt32(drStaff["FilterCount"].ToString());
  381. break;
  382. }
  383. semiTestDefectEntity.DefectPositionID = Convert.ToInt32(drStaff["DefectPositionID"]);
  384. semiTestDefectEntity.DefectNum = drStaff["DefectNum"].ToString() == string.Empty ? 0 :
  385. Convert.ToInt32(drStaff["DefectNum"]);
  386. semiTestDefectEntity.ValueFlag = 1;
  387. semiTestDefectEntitys.Add(semiTestDefectEntity);
  388. Row++;
  389. }
  390. //semiTestDetailEntity.SemiTestDefects = semiTestDefectEntitys.ToArray();
  391. semiTestDetailEntity.SemiTestDefects = semiTestDefectEntitys;
  392. }
  393. semiTestDetailEntitys.Add(semiTestDetailEntity);
  394. }
  395. //semiTestEntitys[0].SemiTestDetails = semiTestDetailEntitys.ToArray();
  396. semiTestEntitys[0].SemiTestDetails = semiTestDetailEntitys;
  397. if (isError)
  398. {
  399. if (ErrorType == Constant.INT_IS_ONE)
  400. {
  401. this.dgvSemiTestDetail.CurrentCell = null;
  402. this.dgvSemiTestDetail.Rows[CurrentRowIndex].Selected = true;
  403. // 提示信息
  404. MessageBox.Show("半检明细添加不完整",
  405. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  406. return;
  407. }
  408. else if (ErrorType == Constant.INT_IS_TWO)
  409. {
  410. this.dgvSemiTestDetail.CurrentCell = null;
  411. this.dgvSemiTestDetail.Rows[DetailCurrentRowIndex].Selected = true;
  412. this.dgvDefectDetail.DataSource =
  413. this.DSTableSemiTestDefectDetail.Tables[string.Format("{0}{1}", this._TableName,
  414. FilterCount)];
  415. this.dgvDefectDetail.CurrentCell = null;
  416. this.dgvDefectDetail.Rows[CurrentRowIndex].Selected = true;
  417. this.dgvDefectDetail.ReadOnly = false;
  418. // 提示信息
  419. MessageBox.Show("半检缺陷明细添加不完整",
  420. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  421. return;
  422. }
  423. }
  424. // 最外层For循环结束
  425. if (semiTestEntitys.Length > Constant.INT_IS_ZERO && this.DSTableSemiTestDetail.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  426. {
  427. string returnValue = (string)DoAsync(new BaseAsyncMethod(() =>
  428. {
  429. return PMModuleProxy.Service.AddSemiTest(semiTestEntitys);
  430. }));
  431. if (string.IsNullOrEmpty(returnValue))//成功
  432. {
  433. //保存成功后,并且为编辑时候,把上次编辑的数据禁用
  434. if (this._semiTestID > Constant.INT_IS_ZERO)
  435. {
  436. int deleteRow = (int)DoAsync(new BaseAsyncMethod(() =>
  437. {
  438. return PMModuleProxy.Service.DeleteSemiTestDataByID(this._semiTestID);
  439. }));
  440. }
  441. // 提示信息
  442. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "新建" + this.Text, "保存"),
  443. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  444. this.DialogResult = DialogResult.OK;
  445. // 保存成功后,清空相应数据源
  446. this.dtpDate.Value = DateTime.Now;
  447. this.txtRemarks.Text = "";
  448. this.DSTableSemiTestDetail.Tables[0].Rows.Clear();
  449. this.DSTableSemiTestDetail.Tables[0].AcceptChanges();
  450. this.DSTableSemiTestDefectDetail.Tables.Clear();
  451. this.dgvSemiTestDetail.DataSource = this.DSTableSemiTestDetail.Tables[0];
  452. this.dgvDefectDetail.DataSource = null;
  453. }
  454. else
  455. {
  456. // 提示信息
  457. MessageBox.Show(returnValue,
  458. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  459. }
  460. }
  461. }
  462. catch (Exception ex)
  463. {
  464. // 对异常进行共通处理
  465. ExceptionManager.HandleEventException(this.ToString(),
  466. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  467. }
  468. }
  469. /// <summary>
  470. /// 单元格值改变后
  471. /// </summary>
  472. /// <param name="sender"></param>
  473. /// <param name="e"></param>
  474. private void dgvSemiTestDetail_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  475. {
  476. if (e.ColumnIndex == Constant.INT_IS_TWO && e.RowIndex != -Constant.INT_IS_ONE)
  477. {
  478. // 当前过滤数
  479. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value.ToString() != string.Empty)
  480. {
  481. this._currentfilterCount = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  482. }
  483. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsID"].Value.ToString() != string.Empty)
  484. {
  485. DataTable dtGoods = this.GoodsID.DataSource as DataTable;
  486. if (dtGoods != null && dtGoods.Rows.Count > Constant.INT_IS_ZERO)
  487. {
  488. DataRow[] dr = dtGoods.Select("GoodsID=" + this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsID"].Value.ToString());
  489. if (dr.Length > Constant.INT_IS_ZERO)
  490. {
  491. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsCode"].Value = dr[0]["GoodsCode"];
  492. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsName"].Value = dr[0]["GoodsName"];
  493. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsSpecification"].Value = dr[0]["GoodsSpecification"];
  494. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsModel"].Value = dr[0]["GoodsModel"];
  495. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["GoodsTypeName"].Value = dr[0]["GoodsTypeName"];
  496. }
  497. }
  498. }
  499. }
  500. if (e.RowIndex != -Constant.INT_IS_ONE)
  501. {
  502. // 当前过滤数
  503. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value != null)
  504. {
  505. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value.ToString() != string.Empty)
  506. {
  507. this._currentfilterCount = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  508. }
  509. if (DSTableSemiTestDefectDetail.Tables.IndexOf(_TableName + this._currentfilterCount) == -Constant.INT_IS_ONE)
  510. {
  511. DataTable dtSemiTestDefectDetail = new DataTable(_TableName + this._currentfilterCount);
  512. dtSemiTestDefectDetail.Columns.Add("DefectID", typeof(decimal));
  513. dtSemiTestDefectDetail.Columns.Add("DefectPositionID", typeof(decimal));
  514. dtSemiTestDefectDetail.Columns.Add("DefectNum");
  515. dtSemiTestDefectDetail.Columns.Add("FilterCount");
  516. DSTableSemiTestDefectDetail.Tables.Add(dtSemiTestDefectDetail);
  517. }
  518. dgvDefectDetail.DataSource = DSTableSemiTestDefectDetail.Tables[_TableName + this._currentfilterCount];
  519. }
  520. }
  521. }
  522. /// <summary>
  523. /// 半检明细选定项改变事件
  524. /// </summary>
  525. /// <param name="sender"></param>
  526. /// <param name="e"></param>
  527. private void dgvSemiTestDetail_SelectionChanged(object sender, EventArgs e)
  528. {
  529. try
  530. {
  531. if (this.dgvSemiTestDetail.CurrentCell != null)
  532. {
  533. // 当前过滤数
  534. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value != null
  535. && this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value.ToString() != string.Empty)
  536. {
  537. dgvDefectDetail.ReadOnly = false;
  538. this._currentfilterCount = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  539. dgvDefectDetail.DataSource = DSTableSemiTestDefectDetail.Tables[_TableName + this._currentfilterCount];
  540. }
  541. else
  542. {
  543. dgvDefectDetail.ReadOnly = true;
  544. }
  545. }
  546. }
  547. catch (Exception ex)
  548. {
  549. // 对异常进行共通处理
  550. ExceptionManager.HandleEventException(this.ToString(),
  551. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  552. }
  553. }
  554. /// <summary>
  555. /// 缺陷添加行事件
  556. /// </summary>
  557. /// <param name="sender"></param>
  558. /// <param name="e"></param>
  559. private void dgvDefectDetail_UserAddedRow(object sender, DataGridViewRowEventArgs e)
  560. {
  561. int row = 0;
  562. if (e.Row.Index != -Constant.INT_IS_ONE)
  563. {
  564. this.dgvDefectDetail.Rows[e.Row.Index].Selected = true;
  565. row = this.dgvDefectDetail.CurrentCell.RowIndex;
  566. }
  567. else
  568. {
  569. this.dgvDefectDetail.Rows[0].Selected = true;
  570. }
  571. string UpFilterCount = "";
  572. if (this.dgvDefectDetail.Rows[row].Cells["DefectFilterCount"].Value != null)
  573. {
  574. UpFilterCount = this.dgvDefectDetail.Rows[row].Cells["DefectFilterCount"].Value.ToString();
  575. }
  576. if (dgvSemiTestDetail.CurrentCell != null)
  577. {
  578. this._currentfilterCount = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  579. }
  580. int temp = this._currentfilterCount;
  581. if (this.dgvSemiTestDetail.CurrentCell != null)
  582. {
  583. // 当前过滤数
  584. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value != null
  585. && this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value.ToString() != string.Empty)
  586. {
  587. temp = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  588. }
  589. }
  590. if (DSTableSemiTestDefectDetail.Tables.IndexOf(_TableName + temp) == -Constant.INT_IS_ONE)
  591. {
  592. DataTable dtSemiTestDefectDetail = new DataTable(_TableName + temp);
  593. dtSemiTestDefectDetail.Columns.Add("DefectID", typeof(decimal));
  594. dtSemiTestDefectDetail.Columns.Add("DefectPositionID", typeof(decimal));
  595. dtSemiTestDefectDetail.Columns.Add("DefectNum");
  596. dtSemiTestDefectDetail.Columns.Add("FilterCount");
  597. DSTableSemiTestDefectDetail.Tables.Add(dtSemiTestDefectDetail);
  598. }
  599. if (UpFilterCount == string.Empty)
  600. {
  601. this.dgvDefectDetail.Rows[this.dgvDefectDetail.CurrentCell.RowIndex].Cells["DefectFilterCount"].Value = temp;
  602. }
  603. this.dgvDefectDetail.Rows[this.dgvDefectDetail.CurrentCell.RowIndex].Cells["DefectFilterCount"].Value = temp;
  604. }
  605. /// <summary>
  606. /// 当前是否有未提交数据事件
  607. /// </summary>
  608. /// <param name="sender"></param>
  609. /// <param name="e"></param>
  610. private void dgvDefectDetail_CurrentCellDirtyStateChanged(object sender, EventArgs e)
  611. {
  612. try
  613. {
  614. if (this.dgvDefectDetail.CurrentCell != null)
  615. {
  616. // 记录最后选择行
  617. if (this.dgvDefectDetail.CurrentCell.ColumnIndex == Constant.INT_IS_ZERO
  618. && this.dgvDefectDetail.CurrentCell.RowIndex != -Constant.INT_IS_ONE)
  619. {
  620. if (dgvDefectDetail.IsCurrentCellDirty)
  621. {
  622. dgvDefectDetail.CommitEdit(DataGridViewDataErrorContexts.Commit);
  623. }
  624. }
  625. }
  626. }
  627. catch (Exception ex)
  628. {
  629. // 对异常进行共通处理
  630. ExceptionManager.HandleEventException(this.ToString(),
  631. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  632. }
  633. }
  634. /// <summary>
  635. /// 单元格选定项改变事件
  636. /// </summary>
  637. /// <param name="sender"></param>
  638. /// <param name="e"></param>
  639. private void dgvDefectDetail_SelectionChanged(object sender, EventArgs e)
  640. {
  641. try
  642. {
  643. if (this.dgvDefectDetail.CurrentCell != null)
  644. {
  645. if (dgvSemiTestDetail.CurrentCell != null)
  646. {
  647. this._currentfilterCount = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["FilterCount"].Value);
  648. this.dgvDefectDetail.ReadOnly = false;
  649. }
  650. else
  651. {
  652. dgvDefectDetail.ReadOnly = true;
  653. }
  654. }
  655. }
  656. catch (Exception ex)
  657. {
  658. // 对异常进行共通处理
  659. ExceptionManager.HandleEventException(this.ToString(),
  660. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  661. }
  662. }
  663. /// <summary>
  664. /// 单元格状态改变事件
  665. /// </summary>
  666. /// <param name="sender"></param>
  667. /// <param name="e"></param>
  668. private void dgvSemiTestDetail_CurrentCellDirtyStateChanged(object sender, EventArgs e)
  669. {
  670. try
  671. {
  672. //if (this.dgvSemiTestDetail.CurrentCell != null)
  673. //{
  674. // // 记录最后选择行
  675. // if (this.dgvSemiTestDetail.CurrentCell.ColumnIndex == Constant.INT_IS_ONE
  676. // && this.dgvSemiTestDetail.CurrentCell.RowIndex != -Constant.INT_IS_ONE)
  677. // {
  678. // if (dgvSemiTestDetail.IsCurrentCellDirty)
  679. // {
  680. // editRow = this.dgvSemiTestDetail.CurrentCell.RowIndex;
  681. // dgvSemiTestDetail.CommitEdit(DataGridViewDataErrorContexts.Commit);
  682. // }
  683. // }
  684. //}
  685. }
  686. catch (Exception ex)
  687. {
  688. // 对异常进行共通处理
  689. ExceptionManager.HandleEventException(this.ToString(),
  690. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  691. }
  692. }
  693. /// <summary>
  694. /// 单元格验证事件
  695. /// </summary>
  696. /// <param name="sender"></param>
  697. /// <param name="e"></param>
  698. private void dgvSemiTestDetail_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
  699. {
  700. try
  701. {
  702. if (e.ColumnIndex == 9 && e.RowIndex != -Constant.INT_IS_ONE)
  703. {
  704. DataGridViewRow rowItem = dgvSemiTestDetail.Rows[e.RowIndex];
  705. DataGridViewColumn columnItem = dgvSemiTestDetail.Columns[e.ColumnIndex];
  706. object columnvalue = rowItem.Cells[columnItem.Name].EditedFormattedValue;
  707. int ScrapNum = 0;
  708. if (columnvalue.ToString() != string.Empty)
  709. {
  710. ScrapNum = Convert.ToInt32(columnvalue.ToString());
  711. }
  712. else
  713. {
  714. this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["ScrapNum"].Value = 0;
  715. }
  716. int TestNum = 0;
  717. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["TestNum"].Value.ToString() != string.Empty)
  718. {
  719. TestNum = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["TestNum"].Value);
  720. }
  721. if (ScrapNum > TestNum)
  722. {
  723. //提示信息
  724. MessageBox.Show(string.Format("报废数不能大于总数"),
  725. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  726. e.Cancel = true;
  727. return;
  728. }
  729. }
  730. if (e.ColumnIndex == 8 && e.RowIndex != -Constant.INT_IS_ONE)
  731. {
  732. DataGridViewRow rowItem = dgvSemiTestDetail.Rows[e.RowIndex];
  733. DataGridViewColumn columnItem = dgvSemiTestDetail.Columns[e.ColumnIndex];
  734. object columnvalue = rowItem.Cells[columnItem.Name].EditedFormattedValue;
  735. int TestNum = 0;
  736. int ScrapNum = 0;
  737. if (columnvalue.ToString() != string.Empty)
  738. {
  739. TestNum = Convert.ToInt32(columnvalue.ToString());
  740. }
  741. if (this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["ScrapNum"].Value.ToString() != string.Empty)
  742. {
  743. ScrapNum = Convert.ToInt32(this.dgvSemiTestDetail.Rows[this.dgvSemiTestDetail.CurrentCell.RowIndex].Cells["ScrapNum"].Value);
  744. }
  745. if (ScrapNum > TestNum)
  746. {
  747. //提示信息
  748. MessageBox.Show(string.Format("总数不能小于报废数"),
  749. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  750. e.Cancel = true;
  751. return;
  752. }
  753. }
  754. }
  755. catch (Exception ex)
  756. {
  757. // 对异常进行共通处理
  758. ExceptionManager.HandleEventException(this.ToString(),
  759. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  760. }
  761. }
  762. #endregion
  763. #region 私有方法
  764. /// <summary>
  765. /// 编辑后设置数据源
  766. /// </summary>
  767. private void SetEditDataSource()
  768. {
  769. try
  770. {
  771. DataSet dsSemiTest = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  772. {
  773. return PMModuleProxy.Service.GetSemiTestByID(this._semiTestID);
  774. }));
  775. if (dsSemiTest != null && dsSemiTest.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  776. {
  777. this.dropUserID.SelectedValue = dsSemiTest.Tables[0].Rows[0]["UserID"].ToString();
  778. this.dtpDate.Value = Convert.ToDateTime(dsSemiTest.Tables[0].Rows[0]["TestDate"]);
  779. this.txtRemarks.Text = dsSemiTest.Tables[0].Rows[0]["Remarks"].ToString();
  780. this._OPTimeStamp = Convert.ToDateTime(dsSemiTest.Tables[0].Rows[0]["OPTimeStamp"]);
  781. if (dsSemiTest.Tables[0].Rows[0]["UserID"].ToString() != string.Empty)
  782. {
  783. this.dropSemiTestType.SelectedValue = dsSemiTest.Tables[0].Rows[0]["SemiTestType"].ToString();
  784. }
  785. // 审核通过,只能查看,禁用控件
  786. if (Convert.ToInt32(dsSemiTest.Tables[0].Rows[0]["AuditStatus"]) == Constant.INT_IS_ONE)
  787. {
  788. this.dropUserID.Enabled = false;
  789. this.dtpDate.Enabled = false;
  790. this.dgvSemiTestDetail.ReadOnly = true;
  791. this.dgvDefectDetail.ReadOnly = true;
  792. this.btnSave.Enabled = false;
  793. this.dropSemiTestType.Enabled = false;
  794. this.txtRemarks.Enabled = false;
  795. }
  796. }
  797. if (dsSemiTest != null && dsSemiTest.Tables[1].Rows.Count > Constant.INT_IS_ZERO)
  798. {
  799. for (int i = 0; i < dsSemiTest.Tables[1].Rows.Count; i++)
  800. {
  801. DataRow dr = DSTableSemiTestDetail.Tables[_TableName + "0"].NewRow();
  802. dr["GroutingUserCode"] = string.Empty;
  803. dr["GroutingUserID"] = dsSemiTest.Tables[1].Rows[i]["GroutingUserID"];
  804. dr["GoodsID"] = dsSemiTest.Tables[1].Rows[i]["GoodsID"];
  805. dr["GoodsCode"] = dsSemiTest.Tables[1].Rows[i]["GoodsCode"];
  806. dr["GoodsName"] = dsSemiTest.Tables[1].Rows[i]["GoodsName"];
  807. dr["GoodsSpecification"] = dsSemiTest.Tables[1].Rows[i]["GoodsSpecification"];
  808. dr["GoodsModel"] = dsSemiTest.Tables[1].Rows[i]["GoodsModel"];
  809. dr["GoodsTypeName"] = dsSemiTest.Tables[1].Rows[i]["GoodsTypeName"];
  810. dr["TestNum"] = dsSemiTest.Tables[1].Rows[i]["TestNum"];
  811. dr["ScrapNum"] = dsSemiTest.Tables[1].Rows[i]["ScrapNum"];
  812. dr["ScrapReason"] = dsSemiTest.Tables[1].Rows[i]["ScrapReason"];
  813. dr["Feedback"] = dsSemiTest.Tables[1].Rows[i]["Feedback"];
  814. dr["FilterCount"] = i;
  815. DSTableSemiTestDetail.Tables[_TableName + "0"].Rows.Add(dr);
  816. // 产品对应的缺陷
  817. DataRow[] drRow = dsSemiTest.Tables[2].Select("SemiTestDetailID=" + dsSemiTest.Tables[1].Rows[i]["SemiTestDetailID"]);
  818. if (drRow.Length > Constant.INT_IS_ZERO)
  819. {
  820. foreach (DataRow r in drRow)
  821. {
  822. if (DSTableSemiTestDefectDetail.Tables.IndexOf(_TableName + i) == -Constant.INT_IS_ONE)
  823. {
  824. DataTable dtSemiTestDefectDetail = new DataTable(_TableName + i);
  825. dtSemiTestDefectDetail.Columns.Add("DefectID", typeof(decimal));
  826. dtSemiTestDefectDetail.Columns.Add("DefectPositionID", typeof(decimal));
  827. dtSemiTestDefectDetail.Columns.Add("DefectNum");
  828. dtSemiTestDefectDetail.Columns.Add("FilterCount");
  829. DSTableSemiTestDefectDetail.Tables.Add(dtSemiTestDefectDetail);
  830. }
  831. DataRow drDefect = DSTableSemiTestDefectDetail.Tables[_TableName + i].NewRow();
  832. drDefect["DefectID"] = r["DefectID"];
  833. drDefect["DefectPositionID"] = r["DefectPositionID"];
  834. drDefect["DefectNum"] = r["DefectNum"];
  835. drDefect["FilterCount"] = i;
  836. DSTableSemiTestDefectDetail.Tables[_TableName + i].Rows.Add(drDefect);
  837. }
  838. }
  839. else
  840. {
  841. if (DSTableSemiTestDefectDetail.Tables.IndexOf(_TableName + i) == -Constant.INT_IS_ONE)
  842. {
  843. DataTable dtSemiTestDefectDetail = new DataTable(_TableName + i);
  844. dtSemiTestDefectDetail.Columns.Add("DefectID", typeof(decimal));
  845. dtSemiTestDefectDetail.Columns.Add("DefectPositionID", typeof(decimal));
  846. dtSemiTestDefectDetail.Columns.Add("DefectNum");
  847. dtSemiTestDefectDetail.Columns.Add("FilterCount");
  848. DSTableSemiTestDefectDetail.Tables.Add(dtSemiTestDefectDetail);
  849. }
  850. }
  851. this._filterCount = this._filterCount + 1;
  852. }
  853. }
  854. }
  855. catch (Exception ex)
  856. {
  857. throw ex;
  858. }
  859. }
  860. /// <summary>
  861. /// 获取当前工号权限
  862. /// </summary>
  863. protected void getPurview()
  864. {
  865. try
  866. {
  867. StringBuilder sbUserPurview = new StringBuilder();
  868. //获取用户权限集
  869. DataSet dsUserPurview = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  870. {
  871. return SystemModuleProxy.Service.GetUserPurview(4, Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.UserID);
  872. }));
  873. //拼接字符串
  874. if (dsUserPurview != null)
  875. {
  876. foreach (DataRow dr in dsUserPurview.Tables[Constant.INT_IS_ZERO].Rows)
  877. {
  878. sbUserPurview.Append(dr[Constant.INT_IS_ZERO].ToString() + ",");
  879. }
  880. if (sbUserPurview.Length != Constant.INT_IS_ZERO)
  881. {
  882. this._userPurviews = sbUserPurview.ToString().Substring(Constant.INT_IS_ZERO, sbUserPurview.Length - 1);
  883. }
  884. }
  885. }
  886. catch (Exception ex)
  887. {
  888. throw ex;
  889. }
  890. }
  891. #endregion
  892. }
  893. }