F_TAT_0101.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_TAT_0101.cs
  5. * 2.功能描述:缺陷扣罚策略一览
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 庄天威 2014/11/18 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Windows.Forms;
  13. using Dongke.IBOSS.PRD.Basics.BaseResources;
  14. using Dongke.IBOSS.PRD.Basics.DockPanel;
  15. using Dongke.IBOSS.PRD.Client.CommonModule;
  16. using Dongke.IBOSS.PRD.Client.DataModels;
  17. using Dongke.IBOSS.PRD.WCF.DataModels;
  18. using Dongke.IBOSS.PRD.WCF.Proxys;
  19. using Dongke.IBOSS.PRD.WCF.Proxys.TATModuleService;
  20. namespace Dongke.IBOSS.PRD.Client.TATModule
  21. {
  22. /// <summary>
  23. /// 缺陷扣罚策略一览
  24. /// </summary>
  25. public partial class F_TAT_0101 : DockPanelBase
  26. {
  27. #region 成员变量
  28. // 单例模式
  29. private static F_TAT_0101 _instance;
  30. // 检索用加载条件实体
  31. private DefectFineEntity _dfEntity = new DefectFineEntity();
  32. // 审核状态选择值
  33. private int? _auditStatusValue;
  34. // 缺陷扣罚选择值
  35. private int? _defectFineValue;
  36. // 策略类型选择值
  37. private int? _salaryTypeValue;
  38. // 扣罚类型选择值
  39. private int? _fineTypeValue;
  40. #endregion
  41. #region 构造函数
  42. /// <summary>
  43. /// 窗体构造函数
  44. /// </summary>
  45. private F_TAT_0101()
  46. {
  47. InitializeComponent();
  48. this.Text = FormTitles.F_TAT_0101;
  49. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  50. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  51. this.tsbtnCopy.Text = ButtonText.TSBTN_COPY;
  52. this.tsbtnDetail.Text = ButtonText.TSBTN_DETAIL;
  53. this.tsbtnDisable.Text = ButtonText.TSBTN_DISABLE;
  54. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  55. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  56. this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
  57. }
  58. #endregion
  59. #region 单例模式
  60. /// <summary>
  61. /// 单例模式
  62. /// </summary>
  63. public static F_TAT_0101 Instance
  64. {
  65. get
  66. {
  67. if (_instance == null)
  68. {
  69. _instance = new F_TAT_0101();
  70. }
  71. return _instance;
  72. }
  73. }
  74. #endregion
  75. #region 事件处理
  76. /// <summary>
  77. /// 窗体加载
  78. /// </summary>
  79. /// <param name="sender"></param>
  80. /// <param name="e"></param>
  81. private void F_TAT_0101_Load(object sender, EventArgs e)
  82. {
  83. try
  84. {
  85. // 加载权限
  86. //FormPermissionManager.FormPermissionControl(this.Name, this,
  87. // LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData, LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  88. this.dgvDefectFine.AutoGenerateColumns = false;
  89. //绑定页面各查询条件的数据源
  90. this.BindSelectData();
  91. }
  92. catch (Exception ex)
  93. {
  94. // 对异常进行共通处理
  95. ExceptionManager.HandleEventException(this.ToString(),
  96. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  97. }
  98. }
  99. /// <summary>
  100. /// 查询一览
  101. /// </summary>
  102. /// <param name="sender"></param>
  103. /// <param name="e"></param>
  104. private void btnSearch_Click(object sender, EventArgs e)
  105. {
  106. try
  107. {
  108. //绑定下拉框数据
  109. this.BindSelectedData();
  110. //获取数据源
  111. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  112. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  113. {
  114. this.BindGridView(srEntity.Data.Tables[0]);
  115. }
  116. //服务实体共通处理
  117. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  118. }
  119. catch (Exception ex)
  120. {
  121. // 对异常进行共通处理
  122. ExceptionManager.HandleEventException(this.ToString(),
  123. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  124. }
  125. }
  126. /// <summary>
  127. /// 清空条件
  128. /// </summary>
  129. /// <param name="sender"></param>
  130. /// <param name="e"></param>
  131. private void btnClearCondition_Click(object sender, EventArgs e)
  132. {
  133. this.txtDefectFineName.Text = string.Empty;
  134. this.lbxAuditStatus.Text = string.Empty;
  135. this._auditStatusValue = null;
  136. this.lbxDefectFine.Text = string.Empty;
  137. this._defectFineValue = null;
  138. this.txtRemarks.Text = string.Empty;
  139. this.cbStartTime.Checked = false;
  140. this.cbEndTime.Checked = false;
  141. this.lbxFineType.Text = string.Empty;
  142. this._fineTypeValue = null;
  143. this.lbxSalaryType.Text = string.Empty;
  144. this._salaryTypeValue = null;
  145. }
  146. /// <summary>
  147. /// 新建信息
  148. /// </summary>
  149. /// <param name="sender"></param>
  150. /// <param name="e"></param>
  151. private void tsbtnAdd_Click(object sender, EventArgs e)
  152. {
  153. try
  154. {
  155. //以新建模式打开信息窗体
  156. F_TAT_0103 frmTAT0103 = new F_TAT_0103(Constant.FormMode.Add, 0);
  157. DialogResult dialogResult = frmTAT0103.ShowDialog();
  158. //操作成功后刷新数据源
  159. if (dialogResult == DialogResult.OK)
  160. {
  161. this.dgvDefectFine.DataSource = null;
  162. this.BindSelectedData();
  163. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  164. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  165. {
  166. this.BindGridView(srEntity.Data.Tables[0]);
  167. }
  168. //服务实体共通处理
  169. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  170. }
  171. }
  172. catch (Exception ex)
  173. {
  174. // 对异常进行共通处理
  175. ExceptionManager.HandleEventException(this.ToString(),
  176. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  177. }
  178. }
  179. /// <summary>
  180. /// 复制添加信息
  181. /// </summary>
  182. /// <param name="sender"></param>
  183. /// <param name="e"></param>
  184. private void tsbtnCopy_Click(object sender, EventArgs e)
  185. {
  186. try
  187. {
  188. DataGridViewRow currentRow = this.dgvDefectFine.CurrentRow;
  189. if (currentRow != null)
  190. {
  191. //获取需要添加明细的信息ID
  192. int entityId = Convert.ToInt32(currentRow.Cells["colDefectFineID"].Value);
  193. //以复制模式打开信息窗体
  194. F_TAT_0103 frmTAT0103 = new F_TAT_0103(Constant.FormMode.CopyAndAdd, entityId);
  195. DialogResult dialogResult = frmTAT0103.ShowDialog();
  196. //操作成功后刷新数据源
  197. if (dialogResult == DialogResult.OK)
  198. {
  199. this.dgvDefectFine.DataSource = null;
  200. this.BindSelectedData();
  201. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  202. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  203. {
  204. this.BindGridView(srEntity.Data.Tables[0]);
  205. }
  206. //服务实体共通处理
  207. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  208. }
  209. }
  210. }
  211. catch (Exception ex)
  212. {
  213. // 对异常进行共通处理
  214. ExceptionManager.HandleEventException(this.ToString(),
  215. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  216. }
  217. }
  218. /// <summary>
  219. /// 编辑信息
  220. /// </summary>
  221. /// <param name="sender"></param>
  222. /// <param name="e"></param>
  223. private void tsbtnEdit_Click(object sender, EventArgs e)
  224. {
  225. try
  226. {
  227. DataGridViewRow currentRow = this.dgvDefectFine.CurrentRow;
  228. if (currentRow != null)
  229. {
  230. //获取需要添加明细的信息ID
  231. int entityId = Convert.ToInt32(currentRow.Cells["colDefectFineID"].Value);
  232. //以编辑模式打开信息窗体
  233. F_TAT_0103 frmTAT0103 = new F_TAT_0103(Constant.FormMode.Edit, entityId);
  234. DialogResult dialogResult = frmTAT0103.ShowDialog();
  235. //操作成功后刷新数据源
  236. if (dialogResult == DialogResult.OK)
  237. {
  238. this.dgvDefectFine.DataSource = null;
  239. this.BindSelectedData();
  240. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  241. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  242. {
  243. this.BindGridView(srEntity.Data.Tables[0]);
  244. }
  245. //服务实体共通处理
  246. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  247. }
  248. }
  249. }
  250. catch (Exception ex)
  251. {
  252. // 对异常进行共通处理
  253. ExceptionManager.HandleEventException(this.ToString(),
  254. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  255. }
  256. }
  257. /// <summary>
  258. /// 操作明细
  259. /// </summary>
  260. /// <param name="sender"></param>
  261. /// <param name="e"></param>
  262. private void tsbtnDetail_Click(object sender, EventArgs e)
  263. {
  264. try
  265. {
  266. DataGridViewRow currentRow = this.dgvDefectFine.CurrentRow;
  267. if (currentRow != null)
  268. {
  269. //获取需要添加明细的信息ID
  270. int entityId = Convert.ToInt32(currentRow.Cells["colDefectFineID"].Value);
  271. //以编辑模式打开明细窗体
  272. F_TAT_0102 frmTAT0102 = new F_TAT_0102(Constant.FormMode.Edit, entityId);
  273. DialogResult dialogResult = frmTAT0102.ShowDialog();
  274. //操作成功后刷新数据源
  275. if (dialogResult == DialogResult.OK)
  276. {
  277. this.dgvDefectFine.DataSource = null;
  278. this.BindSelectedData();
  279. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  280. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  281. {
  282. this.BindGridView(srEntity.Data.Tables[0]);
  283. }
  284. //服务实体共通处理
  285. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  286. }
  287. }
  288. }
  289. catch (Exception ex)
  290. {
  291. // 对异常进行共通处理
  292. ExceptionManager.HandleEventException(this.ToString(),
  293. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  294. }
  295. }
  296. /// <summary>
  297. /// 审核信息
  298. /// </summary>
  299. /// <param name="sender"></param>
  300. /// <param name="e"></param>
  301. private void tsbtnApprover_Click(object sender, EventArgs e)
  302. {
  303. try
  304. {
  305. DataGridViewRow currentRow = this.dgvDefectFine.CurrentRow;
  306. if (currentRow != null)
  307. {
  308. //获取需审核的信息ID
  309. int entityId = Convert.ToInt32(currentRow.Cells["colDefectFineID"].Value);
  310. //编辑窗体以审核模式开启
  311. F_TAT_0103 frmTAT0103 = new F_TAT_0103(Constant.FormMode.Display, entityId);
  312. DialogResult dialogResult = frmTAT0103.ShowDialog();
  313. //操作成功后刷新数据源与列表
  314. if (dialogResult == DialogResult.OK)
  315. {
  316. this.dgvDefectFine.DataSource = null;
  317. this.BindSelectedData();
  318. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  319. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  320. {
  321. this.BindGridView(srEntity.Data.Tables[0]);
  322. }
  323. //服务实体共通处理
  324. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  325. }
  326. }
  327. }
  328. catch (Exception ex)
  329. {
  330. // 对异常进行共通处理
  331. ExceptionManager.HandleEventException(this.ToString(),
  332. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  333. }
  334. }
  335. /// <summary>
  336. /// 停用信息
  337. /// </summary>
  338. /// <param name="sender"></param>
  339. /// <param name="e"></param>
  340. private void tsbtnDisable_Click(object sender, EventArgs e)
  341. {
  342. try
  343. {
  344. DataGridViewRow currentRow = this.dgvDefectFine.CurrentRow;
  345. if (currentRow != null)
  346. {
  347. DefectFineEntity dfEntity = new DefectFineEntity();
  348. //获取ID以及时间戳
  349. dfEntity.DefectFineID = Convert.ToInt32(currentRow.Cells["colDefectFineID"].Value);
  350. dfEntity.OPTimeStamp = Convert.ToDateTime(currentRow.Cells["colOPTimeStamp"].Value);
  351. ServiceResultEntity srEntity = (ServiceResultEntity)DoAsync(() =>
  352. {
  353. return TATModuleProxy.Service.StopDefectFine(dfEntity);
  354. });
  355. //服务实体共通处理
  356. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  357. //成功后刷新数据源
  358. if (srEntity.Status == Constant.ServiceResultStatus.Success)
  359. {
  360. this.dgvDefectFine.DataSource = null;
  361. this.BindSelectedData();
  362. srEntity = (ServiceResultEntity)DoAsync(this.GetDate);
  363. if (srEntity.Data != null && srEntity.Data.Tables.Count != 0)
  364. {
  365. this.BindGridView(srEntity.Data.Tables[0]);
  366. }
  367. //服务实体共通处理
  368. ServiceResultEntityManager.HandleServiceResultEntity(srEntity, this.Text);
  369. }
  370. }
  371. }
  372. catch (Exception ex)
  373. {
  374. // 对异常进行共通处理
  375. ExceptionManager.HandleEventException(this.ToString(),
  376. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  377. }
  378. }
  379. /// <summary>
  380. /// 自适应列宽
  381. /// </summary>
  382. /// <param name="sender"></param>
  383. /// <param name="e"></param>
  384. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  385. {
  386. this.dgvDefectFine.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  387. }
  388. /// <summary>
  389. /// 关闭窗口
  390. /// </summary>
  391. /// <param name="sender"></param>
  392. /// <param name="e"></param>
  393. private void tsbtnClose_Click(object sender, EventArgs e)
  394. {
  395. this.Close();
  396. }
  397. /// <summary>
  398. /// 开始时间条件有效性更改
  399. /// </summary>
  400. /// <param name="sender"></param>
  401. /// <param name="e"></param>
  402. private void cbStartTime_CheckedChanged(object sender, EventArgs e)
  403. {
  404. this.dtpStartTimeBetween.Enabled = this.cbStartTime.Checked;
  405. this.dtpStartTimeAfter.Enabled = this.cbStartTime.Checked;
  406. }
  407. /// <summary>
  408. /// 结束时间条件有效性更改
  409. /// </summary>
  410. /// <param name="sender"></param>
  411. /// <param name="e"></param>
  412. private void cbEndTime_CheckedChanged(object sender, EventArgs e)
  413. {
  414. this.dtpEndTimeBetween.Enabled = this.cbEndTime.Checked;
  415. this.dtpEndTimeAfter.Enabled = this.cbEndTime.Checked;
  416. }
  417. /// <summary>
  418. /// 释放单例
  419. /// </summary>
  420. /// <param name="sender"></param>
  421. /// <param name="e"></param>
  422. private void F_TAT_0101_FormClosed(object sender, FormClosedEventArgs e)
  423. {
  424. _instance = null;
  425. }
  426. /// <summary>
  427. /// 选择信息后,工具条按钮的变化
  428. /// </summary>
  429. /// <param name="sender"></param>
  430. /// <param name="e"></param>
  431. private void dgvDefectFine_SelectionChanged(object sender, EventArgs e)
  432. {
  433. DataGridViewRow gvrNow = this.dgvDefectFine.CurrentRow;
  434. if (gvrNow != null)
  435. {
  436. //如果是待审核就可以进行修改以及审核以及停用
  437. if (Convert.ToInt32(gvrNow.Cells["colAuditStatus"].Value)
  438. == Convert.ToInt32(Constant.AuditStatus.Pending))
  439. {
  440. this.tsbtnEdit.Enabled = true;
  441. this.tsbtnApprover.Enabled = true;
  442. this.tsbtnDisable.Enabled = true;
  443. //同时如果是按照金额扣罚的,还可以进行明细操作以及复制操作
  444. if (gvrNow.Cells["colFineType"].Value.ToString() == Constant.FineTypeName[1])
  445. {
  446. this.tsbtnDetail.Enabled = true;
  447. this.tsbtnCopy.Enabled = true;
  448. }
  449. else
  450. {
  451. this.tsbtnDetail.Enabled = false;
  452. this.tsbtnCopy.Enabled = false;
  453. }
  454. }
  455. else //否则不可以
  456. {
  457. //如果是审批通过的则不可以删除
  458. if (Convert.ToInt32(gvrNow.Cells["colAuditStatus"].Value)
  459. == Convert.ToInt32(Constant.AuditStatus.Agree))
  460. {
  461. this.tsbtnDisable.Enabled = false;
  462. }
  463. else
  464. {
  465. this.tsbtnDisable.Enabled = true;
  466. }
  467. this.tsbtnEdit.Enabled = false;
  468. this.tsbtnApprover.Enabled = false;
  469. this.tsbtnDetail.Enabled = false;
  470. if (gvrNow.Cells["colFineType"].Value.ToString() == Constant.FineTypeName[1])
  471. {
  472. this.tsbtnCopy.Enabled = true;
  473. }
  474. else
  475. {
  476. this.tsbtnCopy.Enabled = false;
  477. }
  478. }
  479. }
  480. }
  481. #endregion
  482. #region 私有方法
  483. /// <summary>
  484. /// 绑定检索条件数据
  485. /// </summary>
  486. private void BindSelectData()
  487. {
  488. try
  489. {
  490. //绑定审核状态
  491. DataSet dsStatus = SystemModuleProxy.Service.GetAuditStatus();
  492. this.lbxAuditStatus.DataSource = dsStatus.Tables[0];
  493. this.lbxAuditStatus.ValueMember = "AuditStatusID";
  494. this.lbxAuditStatus.DisplayMember = "AuditStatusName";
  495. this.lbxAuditStatus.Text = "";
  496. //绑定缺陷扣罚
  497. DataTable dtDefectFine = SystemModuleProxy.Service.GetDataDictionaryByType(Constant.DictionaryType.ASE002, Constant.INT_IS_ONE);
  498. if (dtDefectFine != null)
  499. {
  500. this.lbxDefectFine.DisplayMember = "DictionaryValue";
  501. this.lbxDefectFine.ValueMember = "DictionaryID";
  502. this.lbxDefectFine.DataSource = dtDefectFine;
  503. this.lbxDefectFine.Text = "";
  504. }
  505. //绑定策略类型
  506. DataTable dtSalaryType = new DataTable();
  507. dtSalaryType.Columns.Add("SalaryTypeValue");
  508. dtSalaryType.Columns.Add("SalaryTypeName");
  509. Type SalaryTypeEnum = typeof(Constant.SalaryType);
  510. Array SalaryTypeArray = Enum.GetValues(SalaryTypeEnum);
  511. for (int i = 0; i < Constant.SalaryTypeName.Length; i++)
  512. {
  513. dtSalaryType.Rows.Add(Convert.ToInt32(SalaryTypeArray.GetValue(i)), Constant.SalaryTypeName[i]);
  514. }
  515. this.lbxSalaryType.DisplayMember = "SalaryTypeName";
  516. this.lbxSalaryType.ValueMember = "SalaryTypeValue";
  517. this.lbxSalaryType.DataSource = dtSalaryType;
  518. this.lbxSalaryType.Text = "";
  519. //绑定扣罚类型
  520. DataTable dtFineType = new DataTable();
  521. dtFineType.Columns.Add("FineTypeValue");
  522. dtFineType.Columns.Add("FineTypeName");
  523. Type FineTypeEnum = typeof(Constant.FineType);
  524. Array FineTypeArray = Enum.GetValues(FineTypeEnum);
  525. for (int i = 0; i < Constant.FineTypeName.Length; i++)
  526. {
  527. dtFineType.Rows.Add(Convert.ToInt32(FineTypeArray.GetValue(i)), Constant.FineTypeName[i]);
  528. }
  529. this.lbxFineType.DisplayMember = "FineTypeName";
  530. this.lbxFineType.ValueMember = "FineTypeValue";
  531. this.lbxFineType.DataSource = dtFineType;
  532. this.lbxFineType.Text = "";
  533. }
  534. catch (Exception ex)
  535. {
  536. throw ex;
  537. }
  538. }
  539. /// <summary>
  540. /// 获取页面的输入值
  541. /// </summary>
  542. private void BindSelectedData()
  543. {
  544. try
  545. {
  546. this.dgvDefectFine.DataSource = null;
  547. //下拉框的值
  548. if (this.lbxDefectFine.SelectedValue != null)
  549. {
  550. this._defectFineValue = Convert.ToInt32(this.lbxDefectFine.SelectedValue);
  551. }
  552. else
  553. {
  554. this._defectFineValue = null;
  555. }
  556. if (this.lbxSalaryType.SelectedValue != null)
  557. {
  558. this._salaryTypeValue = Convert.ToInt32(this.lbxSalaryType.SelectedValue);
  559. }
  560. else
  561. {
  562. this._salaryTypeValue = null;
  563. }
  564. if (this.lbxAuditStatus.SelectedValue != null)
  565. {
  566. this._auditStatusValue = Convert.ToInt32(this.lbxAuditStatus.SelectedValue);
  567. }
  568. else
  569. {
  570. this._auditStatusValue = null;
  571. }
  572. if (this.lbxFineType.SelectedValue != null)
  573. {
  574. this._fineTypeValue = Convert.ToInt32(this.lbxFineType.SelectedValue);
  575. }
  576. else
  577. {
  578. this._fineTypeValue = null;
  579. }
  580. //为查询用实体赋值
  581. this._dfEntity = new DefectFineEntity();
  582. if (!string.IsNullOrWhiteSpace(this.txtDefectFineName.Text))
  583. {
  584. this._dfEntity.DefectFineName = this.txtDefectFineName.Text.Trim();
  585. }
  586. if (this._defectFineValue != null)
  587. {
  588. this._dfEntity.DefectFine = this._defectFineValue;
  589. }
  590. if (this._auditStatusValue != null)
  591. {
  592. this._dfEntity.AuditStatus = this._auditStatusValue;
  593. }
  594. if (!string.IsNullOrWhiteSpace(this.txtRemarks.Text))
  595. {
  596. this._dfEntity.Remarks = this.txtRemarks.Text;
  597. }
  598. if (this.cbStartTime.Checked)
  599. {
  600. this._dfEntity.BeginAccountMonth = this.dtpStartTimeBetween.Value.Date;
  601. this._dfEntity.BeginAccountMonthEnd = this.dtpStartTimeAfter.Value.Date
  602. .AddHours(23).AddMinutes(59).AddSeconds(59);
  603. }
  604. if (this.cbEndTime.Checked)
  605. {
  606. this._dfEntity.EndAccountMonth = this.dtpEndTimeBetween.Value;
  607. this._dfEntity.EndAccountMonthEnd = this.dtpEndTimeAfter.Value.Date
  608. .AddHours(23).AddMinutes(59).AddSeconds(59);
  609. }
  610. if (this._salaryTypeValue != null)
  611. {
  612. this._dfEntity.SalaryType = Convert.ToInt32(this._salaryTypeValue);
  613. }
  614. if (this._fineTypeValue != null)
  615. {
  616. this._dfEntity.FineType = Convert.ToInt32(this._fineTypeValue);
  617. }
  618. }
  619. catch (Exception ex)
  620. {
  621. throw ex;
  622. }
  623. }
  624. /// <summary>
  625. /// 绑定列表查询数据
  626. /// </summary>
  627. private ServiceResultEntity GetDate()
  628. {
  629. try
  630. {
  631. return TATModuleProxy.Service.GetDefectFine(this._dfEntity);
  632. }
  633. catch (Exception ex)
  634. {
  635. throw ex;
  636. }
  637. }
  638. /// <summary>
  639. /// 绑定页面数据源
  640. /// </summary>
  641. /// <param name="dtSourse">数据源TABLE</param>
  642. private void BindGridView(DataTable dtSourse)
  643. {
  644. this.dgvDefectFine.DataSource = dtSourse;
  645. this.dgvDefectFine.ReadOnly = true;
  646. }
  647. #endregion
  648. }
  649. }