F_TAT_0202.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_TAT_0202.cs
  5. * 2.功能描述:工价策略明细
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 庄天威 2014/11/18 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Windows.Forms;
  14. using Dongke.IBOSS.PRD.Basics.BaseControls;
  15. using Dongke.IBOSS.PRD.Basics.BaseResources;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.Client.Controls;
  18. using Dongke.IBOSS.PRD.WCF.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.Proxys;
  20. using Dongke.IBOSS.PRD.WCF.Proxys.SystemModuleService;
  21. using Dongke.IBOSS.PRD.WCF.Proxys.TATModuleService;
  22. namespace Dongke.IBOSS.PRD.Client.TATModule
  23. {
  24. /// <summary>
  25. /// 工价策略明细
  26. /// </summary>
  27. public partial class F_TAT_0202 : FormBase
  28. {
  29. #region 成员变量
  30. // 窗体模式ID
  31. private Constant.FormMode _formType;
  32. // 操作实体ID
  33. private int? _entityId;
  34. // 操作实体
  35. private WagesEntity _wagesEntity = new WagesEntity();
  36. // 选择窗体弹出标识
  37. private bool _showFlag = true;
  38. // 数据源
  39. private DataSet _dsSourse;
  40. // 窗体加载完毕标识
  41. private bool _pageLoadOK = false;
  42. #endregion
  43. #region 构造函数
  44. /// <summary>
  45. /// 窗体构造
  46. /// </summary>
  47. /// <param name="formType">窗体开启模式</param>
  48. /// <param name="entityId">操作实体ID</param>
  49. public F_TAT_0202(Constant.FormMode formType, int entityId)
  50. {
  51. InitializeComponent();
  52. this._formType = formType;
  53. this._entityId = entityId;
  54. this.tsbtnCreateJobs.Visible = false;
  55. // 窗口标题
  56. this.Text = FormTitles.F_TAT_0202;
  57. // 按钮
  58. this.btnSubmit.Text = ButtonText.BTN_SAVE;
  59. this.btnClose.Text = ButtonText.BTN_CANCEL;
  60. }
  61. #endregion
  62. #region 事件处理
  63. /// <summary>
  64. /// 窗体加载
  65. /// </summary>
  66. /// <param name="sender"></param>
  67. /// <param name="e"></param>
  68. private void F_TAT_0202_Load(object sender, EventArgs e)
  69. {
  70. try
  71. {
  72. this.cbCeremonial.Checked = true;
  73. this.BindJobsPriceType();
  74. //无论如何先绑定工种,即使没有信息,也需要Table的结构
  75. this.dgvJobs.AutoGenerateColumns = false;
  76. this.BindJobs();
  77. //如果是编辑或审核模式,还要绑定主体信息
  78. if(this._formType == Constant.FormMode.Edit || this._formType == Constant.FormMode.Display)
  79. {
  80. this.BindPage();
  81. //并将所有已存在的信息的类别列解除只读
  82. foreach(DataGridViewRow gvrFor in this.dgvJobs.Rows)
  83. {
  84. if(gvrFor.IsNewRow)
  85. {
  86. break;
  87. }
  88. gvrFor.Cells["PriceType"].ReadOnly = false;
  89. int TypeValue = Convert.ToInt32(gvrFor.Cells["PriceType"].Value);
  90. if (TypeValue == 3 || TypeValue == 4)
  91. {
  92. gvrFor.Cells["OneCount"].ReadOnly = false;
  93. gvrFor.Cells["OnePrice"].ReadOnly = false;
  94. //根据计车及计重量,设置单位单元格的小数精度
  95. Point dnInt = new Point(6, 0);
  96. Point dnDob = new Point(6, 6);
  97. if (TypeValue == 3)
  98. {
  99. ((C_DGV_Cell_Digital)gvrFor.Cells["OneCount"]).Number = dnInt;
  100. }
  101. else
  102. {
  103. ((C_DGV_Cell_Digital)gvrFor.Cells["OneCount"]).Number = dnDob;
  104. }
  105. }
  106. }
  107. this.dgvJobs.IsSetInputColumnsColor = true;
  108. this.tsbtnOther.Visible = true;
  109. }
  110. else
  111. {
  112. //新建模式下是不可以进入明细的
  113. if (this._formType == Constant.FormMode.Add)
  114. {
  115. this.tsbtnOther.Visible = false;
  116. }
  117. else //复制模式不可编辑明细
  118. {
  119. this.dgvJobs.ReadOnly = true;
  120. this.dgvJobs.IsSetInputColumnsColor = false;
  121. this.dgvJobs.AllowUserToAddRows = false;
  122. }
  123. }
  124. //页面加载完毕
  125. this._pageLoadOK = true;
  126. //如果是审核及观看模式
  127. if (this._formType == Constant.FormMode.Display)
  128. {
  129. this.btnPass.Visible = true;
  130. this.btnReturn.Visible = true;
  131. //列表设置为只读
  132. this.dgvJobs.ReadOnly = true;
  133. this.dgvJobs.IsSetInputColumnsColor = false;
  134. this.dgvJobs.AllowUserToAddRows = false;
  135. this.dgvJobs.AllowUserToDeleteRows = false;
  136. //控件除关闭外全部不可用
  137. this.txtWagesName.Enabled = false;
  138. this.txtRemarks.Enabled = false;
  139. this.dtpStartTime.Enabled = false;
  140. this.cbCeremonial.Enabled = false;
  141. this.cbTrial.Enabled = false;
  142. this.tsbtnCreateJobs.Enabled = false;
  143. this.btnSubmit.Enabled = false;
  144. }
  145. }
  146. catch(Exception ex)
  147. {
  148. // 对异常进行共通处理
  149. ExceptionManager.HandleEventException(this.ToString(),
  150. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  151. }
  152. }
  153. /// <summary>
  154. /// 批量生成工种
  155. /// </summary>
  156. /// <param name="sender"></param>
  157. /// <param name="e"></param>
  158. private void tsbtnCreateJobs_Click(object sender, EventArgs e)
  159. {
  160. try
  161. {
  162. //需重新加载
  163. this._pageLoadOK = false;
  164. //这句话,因为新建的时候,莫名其妙会多出一个数据源不存在的空行,这样设定就不会出现了。
  165. this.dgvJobs.AllowUserToAddRows = false;
  166. //获取全部工种
  167. DataSet dsJobs = (DataSet)DoAsync(() =>
  168. {
  169. return SystemModuleProxy.Service.GetJobsData(1);
  170. });
  171. //如果获取到了工种
  172. if (dsJobs != null && dsJobs.Tables.Count != 0)
  173. {
  174. //循环生成工种信息并加入到数据源中
  175. foreach (DataRow drFor in dsJobs.Tables[0].Rows)
  176. {
  177. //首先查看该工种在现有数据源中是否存在
  178. int JobIsHave = 0;
  179. foreach (DataRow drSourse in this._dsSourse.Tables[0].Rows)
  180. {
  181. if (drSourse.RowState == DataRowState.Deleted)
  182. {
  183. continue;
  184. }
  185. int drForJobsId = Convert.ToInt32(drFor["JobsId"]);
  186. int drSourseJobsId = Convert.ToInt32(drSourse["JobsId"]);
  187. if (drForJobsId == drSourseJobsId)
  188. {
  189. JobIsHave++;
  190. break;
  191. }
  192. }
  193. //如果不存在才重新生成
  194. if (JobIsHave == 0 && drFor["JobsId"] != DBNull.Value)
  195. {
  196. DataRow drJobs = _dsSourse.Tables[0].NewRow();
  197. drJobs["JobsId"] = drFor["JobsId"];
  198. drJobs["JobsCode"] = drFor["JobsCode"];
  199. drJobs["JobsName"] = drFor["JobsName"];
  200. this._dsSourse.Tables[0].Rows.Add(drJobs);
  201. }
  202. }
  203. //绑定
  204. this.dgvJobs.AutoGenerateColumns = false;
  205. this.dgvJobs.DataSource = this._dsSourse.Tables[0];
  206. }
  207. //加载完毕
  208. this._pageLoadOK = true;
  209. this.dgvJobs.AllowUserToAddRows = true;
  210. this.dgvJobs.IsSetInputColumnsColor = true;
  211. }
  212. catch (Exception ex)
  213. {
  214. // 对异常进行共通处理
  215. ExceptionManager.HandleEventException(this.ToString(),
  216. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  217. }
  218. }
  219. /// <summary>
  220. /// 编辑工种对应明细
  221. /// </summary>
  222. /// <param name="sender"></param>
  223. /// <param name="e"></param>
  224. private void tsbtnOther_Click(object sender, EventArgs e)
  225. {
  226. //获取当前行,如果不为空以及非新建行的话,就可以进入明细页面
  227. DataGridViewRow gvrNow = this.dgvJobs.CurrentRow;
  228. if(gvrNow != null && !gvrNow.IsNewRow)
  229. {
  230. //获取需要添加明细的信息ID
  231. int JobsId = Convert.ToInt32(gvrNow.Cells["JobsId"].Value);
  232. string JobsName = gvrNow.Cells["JobsName"].Value.ToString();
  233. string JobsCode = gvrNow.Cells["JobsCode"].Value.ToString();
  234. //以编辑模式打开信息窗体
  235. F_TAT_0203 frmTAT0203
  236. = new F_TAT_0203(this._formType, Convert.ToInt32(this._wagesEntity.WagesID), JobsId, JobsName, JobsCode);
  237. DialogResult dialogResult = frmTAT0203.ShowDialog();
  238. }
  239. else
  240. {
  241. //不可为空或选择新建行
  242. }
  243. }
  244. /// <summary>
  245. /// 自适应列宽
  246. /// </summary>
  247. /// <param name="sender"></param>
  248. /// <param name="e"></param>
  249. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  250. {
  251. this.dgvJobs.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  252. }
  253. /// <summary>
  254. /// 提交操作
  255. /// </summary>
  256. /// <param name="sender"></param>
  257. /// <param name="e"></param>
  258. private void btnSubmit_Click(object sender, EventArgs e)
  259. {
  260. try
  261. {
  262. if (!ValidationInput())
  263. {
  264. return;
  265. }
  266. //获取页面值绑定属性
  267. this.BindEntity();
  268. //提交操作
  269. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(() =>
  270. {
  271. return this.EntityToServer();
  272. });
  273. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  274. if (srEntity.Status == Constant.ServiceResultStatus.Success)
  275. {
  276. this.DialogResult = DialogResult.OK;
  277. }
  278. }
  279. catch(Exception ex)
  280. {
  281. // 对异常进行共通处理
  282. ExceptionManager.HandleEventException(this.ToString(),
  283. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  284. }
  285. }
  286. private void dgvJobs_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  287. {
  288. try
  289. {
  290. //变更后重新加载
  291. this._pageLoadOK = false;
  292. if (this.dgvJobs.Rows.Count <= 1 || !this._showFlag)
  293. {
  294. return;
  295. }
  296. DataGridViewRow rowItem = this.dgvJobs.Rows[e.RowIndex];
  297. DataGridViewColumn columnItem = this.dgvJobs.Columns[e.ColumnIndex];
  298. if (columnItem.Name == "JobsCode")
  299. {
  300. //打开多选页面进行值绑定
  301. this._showFlag = false;
  302. FormUtility.BindJobsRowDataSource(this.dgvJobs,
  303. e.RowIndex, columnItem.Name, string.Empty);
  304. this._showFlag = true;
  305. //为选中项设定默认值
  306. foreach (DataGridViewRow gvrFor in this.dgvJobs.Rows)
  307. {
  308. if (!gvrFor.IsNewRow && gvrFor.Cells["PriceType"].Value == DBNull.Value)
  309. {
  310. gvrFor.Cells["PriceType"].ReadOnly = false;
  311. gvrFor.Cells["PriceType"].Value = 1;
  312. }
  313. //如果是新行,不可录入工种以外的项
  314. if (gvrFor.IsNewRow)
  315. {
  316. gvrFor.Cells["PriceType"].ReadOnly = true;
  317. gvrFor.Cells["OneCount"].ReadOnly = true;
  318. gvrFor.Cells["OnePrice"].ReadOnly = true;
  319. }
  320. }
  321. }
  322. else if (columnItem.Name == "PriceType")
  323. {
  324. rowItem.Cells["OneCount"].Value = null;
  325. rowItem.Cells["OnePrice"].Value = null;
  326. int TypeValue = Convert.ToInt32(rowItem.Cells["PriceType"].Value);
  327. if (TypeValue != 3 && TypeValue != 4)
  328. {
  329. rowItem.Cells["OneCount"].ReadOnly = true;
  330. rowItem.Cells["OnePrice"].ReadOnly = true;
  331. }
  332. else
  333. {
  334. rowItem.Cells["OneCount"].ReadOnly = false;
  335. rowItem.Cells["OnePrice"].ReadOnly = false;
  336. //根据计车及计重量,设置单位单元格的小数精度
  337. Point dnInt = new Point(6, 0);
  338. Point dnDob = new Point(6, 6);
  339. if (TypeValue == 3)
  340. {
  341. ((C_DGV_Cell_Digital)rowItem.Cells["OneCount"]).Number = dnInt;
  342. }
  343. else
  344. {
  345. ((C_DGV_Cell_Digital)rowItem.Cells["OneCount"]).Number = dnDob;
  346. }
  347. }
  348. }
  349. //加载OK
  350. this._pageLoadOK = true;
  351. // 设置可输入单元格的颜色
  352. this.dgvJobs.IsSetInputColumnsColor = true;
  353. }
  354. catch (Exception ex)
  355. {
  356. // 对异常进行共通处理
  357. ExceptionManager.HandleEventException(this.ToString(),
  358. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  359. }
  360. }
  361. /// <summary>
  362. /// 关闭窗体
  363. /// </summary>
  364. /// <param name="sender"></param>
  365. /// <param name="e"></param>
  366. private void btnClose_Click(object sender, EventArgs e)
  367. {
  368. this.Close();
  369. }
  370. /// <summary>
  371. /// 工种选择改变
  372. /// </summary>
  373. /// <param name="sender"></param>
  374. /// <param name="e"></param>
  375. private void dgvJobs_SelectionChanged(object sender, EventArgs e)
  376. {
  377. try
  378. {
  379. if(!this._pageLoadOK)
  380. {
  381. return;
  382. }
  383. if (this.dgvJobs.SelectedRows.Count != 0)
  384. {
  385. DataGridViewRow gvrFor = this.dgvJobs.SelectedRows[0];
  386. if (gvrFor.IsNewRow)
  387. {
  388. this.tsbtnOther.Enabled = false;
  389. return;
  390. }
  391. int TypeValue = Convert.ToInt32(gvrFor.Cells["PriceType"].Value);
  392. //按车或按重量计,不存在明细
  393. if (TypeValue == 3 || TypeValue == 4)
  394. {
  395. this.tsbtnOther.Enabled = false;
  396. }
  397. else
  398. {
  399. this.tsbtnOther.Enabled = true;
  400. }
  401. }
  402. }
  403. catch(Exception ex)
  404. {
  405. // 对异常进行共通处理
  406. ExceptionManager.HandleEventException(this.ToString(),
  407. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  408. }
  409. }
  410. /// <summary>
  411. /// 通过审核
  412. /// </summary>
  413. /// <param name="sender"></param>
  414. /// <param name="e"></param>
  415. private void btnPass_Click(object sender, EventArgs e)
  416. {
  417. //进行审核操作
  418. this._wagesEntity.AuditStatus = Convert.ToInt32(Constant.AuditStatus.Agree);
  419. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(() =>
  420. {
  421. return EntityToServer();
  422. });
  423. //服务实体共通处理
  424. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  425. if (srEntity.Status == Constant.ServiceResultStatus.Success)
  426. {
  427. this.DialogResult = DialogResult.OK;
  428. }
  429. }
  430. /// <summary>
  431. /// 驳回审核
  432. /// </summary>
  433. /// <param name="sender"></param>
  434. /// <param name="e"></param>
  435. private void btnReturn_Click(object sender, EventArgs e)
  436. {
  437. //进行审核操作
  438. this._wagesEntity.AuditStatus = Convert.ToInt32(Constant.AuditStatus.Disagree);
  439. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(() =>
  440. {
  441. return EntityToServer();
  442. });
  443. //服务实体共通处理
  444. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  445. if (srEntity.Status == Constant.ServiceResultStatus.Success)
  446. {
  447. this.DialogResult = DialogResult.OK;
  448. }
  449. }
  450. #endregion
  451. #region 私有方法/函数
  452. /// <summary>
  453. /// 绑定计件方式
  454. /// </summary>
  455. private void BindJobsPriceType()
  456. {
  457. try
  458. {
  459. DataSet dsPriceType = SystemModuleProxy.Service.GetJobsPriceType();
  460. if(dsPriceType != null && dsPriceType.Tables.Count != 0)
  461. {
  462. this.PriceType.DisplayMember = "JobsPriceTypeName";
  463. this.PriceType.ValueMember = "JobsPriceTypeID";
  464. this.PriceType.DataSource = dsPriceType.Tables[0];
  465. }
  466. }
  467. catch(Exception ex)
  468. {
  469. throw ex;
  470. }
  471. }
  472. /// <summary>
  473. /// 绑定需要操作的实体信息
  474. /// </summary>
  475. private void BindPage()
  476. {
  477. try
  478. {
  479. if (this._entityId != 0 && this._entityId != null)
  480. {
  481. this._wagesEntity.WagesID = this._entityId;
  482. //获取工价策略
  483. ServiceResultEntity srEntity
  484. = TATModuleProxy.Service.GetWages(_wagesEntity);
  485. //如果取出了对应的数据
  486. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0
  487. && srEntity.Data.Tables[0].Rows.Count != 0)
  488. {
  489. //为实体及页面相关赋值
  490. DataSet dsEntityData = (DataSet)srEntity.Data;
  491. DataRow drEntityRow = dsEntityData.Tables[0].Rows[0];
  492. this.txtWagesName.Text = drEntityRow["WagesName"].ToString();
  493. int SalaryType = Convert.ToInt32(drEntityRow["SalaryType"]);
  494. this._wagesEntity.SalaryType = SalaryType;
  495. if (SalaryType == 1)
  496. {
  497. this.cbCeremonial.Checked = true;
  498. }
  499. else
  500. {
  501. this.cbTrial.Checked = true;
  502. }
  503. this.txtRemarks.Text = drEntityRow["Remarks"].ToString();
  504. this.dtpStartTime.Text = drEntityRow["BeginAccountMonth"].ToString();
  505. this._wagesEntity.BeginAccountMonth = Convert.ToDateTime(drEntityRow["BeginAccountMonth"].ToString());
  506. this._wagesEntity.OPTimeStamp = Convert.ToDateTime(drEntityRow["OPTimeStamp"]);
  507. }
  508. }
  509. }
  510. catch(Exception ex)
  511. {
  512. throw ex;
  513. }
  514. }
  515. /// <summary>
  516. /// 绑定对应工种明细
  517. /// </summary>
  518. private void BindJobs()
  519. {
  520. try
  521. {
  522. //获取对应工种明细
  523. ServiceResultEntity srEntityDetail
  524. = TATModuleProxy.Service.GetWagesDetailById(Convert.ToInt32(this._entityId));
  525. if (srEntityDetail.Data != null && srEntityDetail.Data.Tables.Count != 0)
  526. {
  527. this._dsSourse = srEntityDetail.Data;
  528. this.dgvJobs.DataSource = srEntityDetail.Data.Tables[0];
  529. this.dgvJobs.IsSetInputColumnsColor = true;
  530. }
  531. }
  532. catch(Exception ex)
  533. {
  534. throw ex;
  535. }
  536. }
  537. /// <summary>
  538. /// 与服务交互操作
  539. /// </summary>
  540. /// <returns></returns>
  541. private ServiceResultEntity EntityToServer()
  542. {
  543. if (this._formType == Constant.FormMode.Add)
  544. {
  545. return TATModuleProxy.Service.AddWages(this._wagesEntity, _dsSourse);
  546. }
  547. else if (this._formType == Constant.FormMode.Edit)
  548. {
  549. return TATModuleProxy.Service.EditWages(this._wagesEntity, _dsSourse);
  550. }
  551. else if (_formType == Constant.FormMode.CopyAndAdd)
  552. {
  553. this._wagesEntity.CopyId = Convert.ToInt32(this._entityId);
  554. return TATModuleProxy.Service.AddWages(this._wagesEntity, _dsSourse);
  555. }
  556. else if (_formType == Constant.FormMode.Display)
  557. {
  558. return TATModuleProxy.Service.AuditWages(this._wagesEntity);
  559. }
  560. return null;
  561. }
  562. /// <summary>
  563. /// 为实体绑定页面属性
  564. /// </summary>
  565. private void BindEntity()
  566. {
  567. this._wagesEntity.WagesName = this.txtWagesName.Text.Trim();
  568. this._wagesEntity.BeginAccountMonth = this.dtpStartTime.Value.Date;
  569. if (this.cbCeremonial.Checked)
  570. {
  571. this._wagesEntity.SalaryType = 1;
  572. }
  573. else
  574. {
  575. this._wagesEntity.SalaryType = 0;
  576. }
  577. this._wagesEntity.Remarks = this.txtRemarks.Text;
  578. this._wagesEntity.AuditStatus = 0;
  579. }
  580. /// <summary>
  581. /// 验证必填项
  582. /// </summary>
  583. /// <returns>是否通过</returns>
  584. private bool ValidationInput()
  585. {
  586. if (string.IsNullOrWhiteSpace(this.txtWagesName.Text))
  587. {
  588. this.txtWagesName.Focus();
  589. return false;
  590. }
  591. //循环对应工种列表,如果有非计件类别但没有填写单位数量和单位价格,
  592. //或者选择记车的类别后,单位价格非整数的,都不可通过验证
  593. foreach (DataGridViewRow gvrFor in this.dgvJobs.Rows)
  594. {
  595. if (gvrFor.IsNewRow)
  596. {
  597. break;
  598. }
  599. int TypeValue = Convert.ToInt32(gvrFor.Cells["PriceType"].Value);
  600. if (TypeValue == 3 || TypeValue == 4)
  601. {
  602. if (gvrFor.Cells["OneCount"].Value == DBNull.Value ||
  603. gvrFor.Cells["OnePrice"].Value == DBNull.Value)
  604. {
  605. this.dgvJobs.Rows[gvrFor.Index].Selected = true;
  606. return false;
  607. }
  608. }
  609. }
  610. return true;
  611. }
  612. #endregion
  613. }
  614. }