F_RPT_030102_1.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. /*******************************************************************************
  2. * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_RPT_030102_1.cs
  5. * 2.功能描述:产品损坏汇总表
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 袁新成 2015/4/14 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Text;
  13. using System.Windows.Forms;
  14. using Dongke.IBOSS.PRD.Basics.BaseResources;
  15. using Dongke.IBOSS.PRD.Basics.DockPanel;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.Client.Controls;
  18. using Dongke.IBOSS.PRD.Client.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.Proxys;
  21. namespace Dongke.IBOSS.PRD.Client.ReportModule
  22. {
  23. /// <summary>
  24. /// 产品损坏汇总表
  25. /// </summary>
  26. public partial class F_RPT_030102_1 : DKDockPanelBase
  27. {
  28. #region 成员变量
  29. // 窗体的单例模式
  30. private static F_RPT_030102_1 _instance;
  31. //实体类
  32. private RPT030102_SE _rptse = null;
  33. private RPT030102_SE _rptse1 = null;
  34. //默认清空工序,重置回用户当前权限工序
  35. private string _currentUserPurview = null;
  36. //默认清空生产线,重置回用户当前权限生产线
  37. private string _currentUserLinePuview = null;
  38. #endregion
  39. #region 构造函数
  40. public F_RPT_030102_1()
  41. {
  42. InitializeComponent();
  43. // 窗体显示的Title
  44. this.Text = FormTitles.F_RPT_030102;
  45. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  46. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  47. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  48. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  49. this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
  50. }
  51. #endregion
  52. #region 单例模式
  53. /// <summary>
  54. /// 单例模式,防止重复创建窗体
  55. /// </summary>
  56. public static F_RPT_030102_1 Instance
  57. {
  58. get
  59. {
  60. if (_instance == null || _instance.IsDisposed)
  61. {
  62. _instance = new F_RPT_030102_1();
  63. }
  64. return _instance;
  65. }
  66. }
  67. #endregion
  68. #region 事件处理
  69. /// <summary>
  70. /// 窗体加载事件
  71. /// </summary>
  72. /// <param name="sender"></param>
  73. /// <param name="e"></param>
  74. private void F_RPT_030102_1_Load(object sender, EventArgs e)
  75. {
  76. try
  77. {
  78. // 加载权限
  79. FormPermissionManager.FormPermissionControl(this.Name, this,
  80. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  81. LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  82. // 设置表格不自动创建列
  83. this.dgvScrapTotalModule.AutoGenerateColumns = false;
  84. this.dgvScrapTotalModuleDetail.AutoGenerateColumns = false;
  85. //this.dkproductionLineSearchBox.IsEnablePurview = true;
  86. //this.dkProcedureSearchBox.IsEnablePurview = true;
  87. // 初始化时间控件为当前日期
  88. this.dtpScrapDateStart.Value = DateTime.Now.Date;
  89. this.dtpScrapDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  90. //getPurview();
  91. //getPurviewLine()
  92. // wangx 2016-06-21
  93. // 完成时间
  94. this.dtpCDateStart.Value = DateTime.Now.Date;
  95. this.dtpCDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  96. this.dtpCDateStart.Enabled = false;
  97. this.dtpCDateEnd.Enabled = false;
  98. // 交坯时间
  99. this.dtpDDateStart.Value = DateTime.Now.Date;
  100. this.dtpDDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  101. this.dtpDDateStart.Enabled = false;
  102. this.dtpDDateEnd.Enabled = false;
  103. // 注浆时间
  104. this.dtpGDateStart.Value = DateTime.Now.Date;
  105. this.dtpGDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  106. this.dtpGDateStart.Enabled = false;
  107. this.dtpGDateEnd.Enabled = false;
  108. // wangx 2016-06-21 end
  109. // 审核时间
  110. this.dtpAuditDateStart.Value = DateTime.Now.Date;
  111. this.dtpAuditDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  112. this.dtpAuditDateStart.Enabled = false;
  113. this.dtpAuditDateEnd.Enabled = false;
  114. this.chkTestMouldFlag.AllItemCheck();
  115. }
  116. catch (Exception ex)
  117. {
  118. // 对异常进行共通处理
  119. ExceptionManager.HandleEventException(this.ToString(),
  120. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  121. }
  122. }
  123. /// <summary>
  124. /// 窗体关闭事件
  125. /// </summary>
  126. /// <param name="sender"></param>
  127. /// <param name="e"></param>
  128. private void F_RPT_030102_1_FormClosed(object sender, FormClosedEventArgs e)
  129. {
  130. _instance = null;
  131. }
  132. /// <summary>
  133. /// 关闭按钮
  134. /// </summary>
  135. /// <param name="sender"></param>
  136. /// <param name="e"></param>
  137. private void tsbtnClose_Click(object sender, EventArgs e)
  138. {
  139. this.Close();
  140. }
  141. /// <summary>
  142. /// 自动适应列宽
  143. /// </summary>
  144. /// <param name="sender"></param>
  145. /// <param name="e"></param>
  146. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  147. {
  148. if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ZERO)
  149. {
  150. this.dgvScrapTotalModule.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  151. }
  152. else
  153. {
  154. this.dgvScrapTotalModuleDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  155. }
  156. }
  157. /// <summary>
  158. /// 查询按钮事件
  159. /// </summary>
  160. /// <param name="sender"></param>
  161. /// <param name="e"></param>
  162. private void btnSearch_Click(object sender, EventArgs e)
  163. {
  164. try
  165. {
  166. CreateSearchCondition();
  167. if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ZERO)//产品损坏汇总查询
  168. {
  169. this._rptse1 = this._rptse;
  170. this.dgvScrapTotalModule.DataSource = null;
  171. this.dgvScrapTotalModule.DataSource = this.GetSearchTotalData();
  172. }
  173. else //产品损坏明细查询
  174. {
  175. this.dgvScrapTotalModuleDetail.DataSource = null;
  176. this.dgvScrapTotalModuleDetail.DataSource = this.GetSearchDetailData();
  177. }
  178. }
  179. catch (Exception ex)
  180. {
  181. this.btnSearch.Enabled = true;
  182. // 对异常进行共通处理
  183. ExceptionManager.HandleEventException(this.ToString(),
  184. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  185. }
  186. }
  187. /// <summary>
  188. /// 清空条件按钮事件
  189. /// </summary>
  190. /// <param name="sender"></param>
  191. /// <param name="e"></param>
  192. private void btnClearCondition_Click(object sender, EventArgs e)
  193. {
  194. this.dkproductionLineSearchBox.ClearControl();
  195. this.scbGoodsType.ClearValue();
  196. this.txtGoodCode.Clear();
  197. this.dkProcedureSearchBox.ClearControl();
  198. this.dtpScrapDateStart.Value = DateTime.Now.Date;
  199. this.dtpScrapDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  200. this.chkScrapDateStart.Checked = true;
  201. this.dkResponProcedureSearchBox.ClearControl();
  202. this.dkResponUserInfoSearchBox.ClearControl();
  203. //this.dkResponProcedureSearchBox.ProcedureIDS = this._currentUserPurview;
  204. //this.dkproductionLineSearchBox.ProductionLineIDS = this._currentUserLinePuview;
  205. this.txtAuditUser.Clear();
  206. this.txtCreatUser.Clear();
  207. this.chkSpecialRepairFlag.Checked = true;
  208. this.chkReFireFlag.Checked = false;
  209. // 完成时间
  210. this.dtpCDateStart.Value = DateTime.Now.Date;
  211. this.dtpCDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  212. this.dtpCDateStart.Enabled = false;
  213. this.dtpCDateEnd.Enabled = false;
  214. this.chkPDate.Checked = false;
  215. // 交坯时间
  216. this.dtpDDateStart.Value = DateTime.Now.Date;
  217. this.dtpDDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  218. this.dtpDDateStart.Enabled = false;
  219. this.dtpDDateEnd.Enabled = false;
  220. this.chkDDate.Checked = false;
  221. // 注浆时间
  222. this.dtpGDateStart.Value = DateTime.Now.Date;
  223. this.dtpGDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  224. this.dtpGDateStart.Enabled = false;
  225. this.dtpGDateEnd.Enabled = false;
  226. this.chkGDate.Checked = false;
  227. // 审核时间
  228. this.dtpAuditDateStart.Value = DateTime.Now.Date;
  229. this.dtpAuditDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  230. this.dtpAuditDateStart.Enabled = false;
  231. this.dtpAuditDateEnd.Enabled = false;
  232. this.chkAuditDate.Checked = false;
  233. this.chkTestMouldFlag.AllItemCheck();
  234. }
  235. /// <summary>
  236. /// 双击单元格事件
  237. /// </summary>
  238. /// <param name="sender"></param>
  239. /// <param name="e"></param>
  240. private void dgvScrapTotalModule_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  241. {
  242. try
  243. {
  244. //判断是否为空
  245. if (this.dgvScrapTotalModule.CurrentRow == null)
  246. {
  247. return;
  248. }
  249. //获取数据信息
  250. DataGridViewRow dgvr = dgvScrapTotalModule.CurrentRow;
  251. string zruserid = dgvr.Cells["zruserid"].Value.ToString();
  252. string goodsId = dgvr.Cells["GoodsId"].Value.ToString();
  253. string goodstypecode2 = dgvr.Cells["GoodsTypeCode2"].Value.ToString();
  254. string zrprocedureId = dgvr.Cells["ZRProcedureId"].Value.ToString();
  255. string productionlineid = dgvr.Cells["productionlineid"].Value.ToString();
  256. //判断是否选择统计行
  257. //if (!goodsCode.Equals("--"))
  258. //{
  259. // this.tblScrapTotalModule.SelectTab(1);
  260. // //获取查询条件
  261. // //CreateSearchCondition();
  262. // this.rptse1.GoodsIDS = goodsId.ToString();
  263. // //获取工序id
  264. // if (string.IsNullOrEmpty(procedureId))
  265. // {
  266. // this.rptse1.ResponProcedureID = 0;
  267. // }
  268. // else
  269. // {
  270. // this.rptse1.ResponProcedureID = Convert.ToInt32(procedureId);
  271. // }
  272. // this.dgvScrapTotalModuleDetail.DataSource = null;
  273. // this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData(this.rptse1);
  274. //}
  275. if (!string.IsNullOrEmpty(goodsId))
  276. {
  277. this.dgvScrapTotalModuleDetail.DataSource = null;
  278. this.tblScrapTotalModule.SelectTab(1);
  279. //获取条件
  280. this.CreateSearchConditionDetail();
  281. this._rptse.GoodsID = goodsId;
  282. this._rptse.ResponProcedureID = zrprocedureId;
  283. this._rptse.ResponUserID = zruserid;
  284. this.dgvScrapTotalModuleDetail.DataSource = null;
  285. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  286. return;
  287. }
  288. if (!string.IsNullOrEmpty(goodstypecode2))
  289. {
  290. this.dgvScrapTotalModuleDetail.DataSource = null;
  291. this.tblScrapTotalModule.SelectTab(1);
  292. //获取条件
  293. this.CreateSearchConditionDetail();
  294. this._rptse.ResponProcedureID = zrprocedureId;
  295. this._rptse.GoodsTypeCode = goodstypecode2;
  296. this.dgvScrapTotalModuleDetail.DataSource = null;
  297. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  298. return;
  299. }
  300. if (!string.IsNullOrEmpty(productionlineid))
  301. {
  302. this.dgvScrapTotalModuleDetail.DataSource = null;
  303. this.tblScrapTotalModule.SelectTab(1);
  304. //获取条件
  305. this.CreateSearchConditionDetail();
  306. this._rptse.ResponProcedureID = zrprocedureId;
  307. this.dgvScrapTotalModuleDetail.DataSource = null;
  308. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  309. return;
  310. }
  311. this.dgvScrapTotalModuleDetail.DataSource = null;
  312. this.tblScrapTotalModule.SelectTab(1);
  313. //获取条件
  314. this.CreateSearchConditionDetail();
  315. this.dgvScrapTotalModuleDetail.DataSource = null;
  316. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  317. }
  318. catch (Exception ex)
  319. {
  320. this.btnSearch.Enabled = true;
  321. this.btnClearCondition.Enabled = true;
  322. // 对异常进行共通处理
  323. ExceptionManager.HandleEventException(this.ToString(),
  324. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  325. }
  326. }
  327. /// <summary>
  328. /// 报损日期选中改变事件
  329. /// </summary>
  330. /// <param name="sender"></param>
  331. /// <param name="e"></param>
  332. private void chkScrapDateStart_CheckedChanged(object sender, EventArgs e)
  333. {
  334. if (this.chkScrapDateStart.Checked)
  335. {
  336. this.dtpScrapDateStart.Enabled = true;
  337. this.dtpScrapDateEnd.Enabled = true;
  338. }
  339. else
  340. {
  341. this.dtpScrapDateStart.Enabled = false;
  342. this.dtpScrapDateEnd.Enabled = false;
  343. this.dtpScrapDateStart.Value = DateTime.Now.Date;
  344. this.dtpScrapDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  345. }
  346. }
  347. /// <summary>
  348. /// 完成时间选中改变事件
  349. /// </summary>
  350. /// <param name="sender"></param>
  351. /// <param name="e"></param>
  352. private void chkPDate_CheckedChanged(object sender, EventArgs e)
  353. {
  354. if (this.chkPDate.Checked)
  355. {
  356. this.dtpCDateStart.Enabled = true;
  357. this.dtpCDateEnd.Enabled = true;
  358. }
  359. else
  360. {
  361. this.dtpCDateStart.Enabled = false;
  362. this.dtpCDateEnd.Enabled = false;
  363. this.dtpCDateStart.Value = DateTime.Now.Date;
  364. this.dtpCDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  365. }
  366. }
  367. /// <summary>
  368. /// 交坯时间选中改变事件
  369. /// </summary>
  370. /// <param name="sender"></param>
  371. /// <param name="e"></param>
  372. private void chkDDate_CheckedChanged(object sender, EventArgs e)
  373. {
  374. if (this.chkDDate.Checked)
  375. {
  376. this.dtpDDateStart.Enabled = true;
  377. this.dtpDDateEnd.Enabled = true;
  378. }
  379. else
  380. {
  381. this.dtpDDateStart.Enabled = false;
  382. this.dtpDDateEnd.Enabled = false;
  383. this.dtpDDateStart.Value = DateTime.Now.Date;
  384. this.dtpDDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  385. }
  386. }
  387. /// <summary>
  388. /// 注浆时间选中改变事件
  389. /// </summary>
  390. /// <param name="sender"></param>
  391. /// <param name="e"></param>
  392. private void chkGDate_CheckedChanged(object sender, EventArgs e)
  393. {
  394. if (this.chkGDate.Checked)
  395. {
  396. this.dtpGDateStart.Enabled = true;
  397. this.dtpGDateEnd.Enabled = true;
  398. }
  399. else
  400. {
  401. this.dtpGDateStart.Enabled = false;
  402. this.dtpGDateEnd.Enabled = false;
  403. this.dtpGDateStart.Value = DateTime.Now.Date;
  404. this.dtpGDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  405. }
  406. }
  407. /// <summary>
  408. /// 审核日期
  409. /// </summary>
  410. /// <param name="sender"></param>
  411. /// <param name="e"></param>
  412. private void chkAuditDate_CheckedChanged(object sender, EventArgs e)
  413. {
  414. if (this.chkAuditDate.Checked)
  415. {
  416. this.dtpAuditDateStart.Enabled = true;
  417. this.dtpAuditDateEnd.Enabled = true;
  418. }
  419. else
  420. {
  421. this.dtpAuditDateStart.Enabled = false;
  422. this.dtpAuditDateEnd.Enabled = false;
  423. this.dtpAuditDateStart.Value = DateTime.Now.Date;
  424. this.dtpAuditDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  425. }
  426. }
  427. #endregion
  428. #region 私有方法
  429. /// <summary>
  430. /// 搜索条件
  431. /// </summary>
  432. /// <returns></returns>
  433. private void CreateSearchCondition()
  434. {
  435. _rptse = new RPT030102_SE();
  436. _rptse.ProductionLineID = this.dkproductionLineSearchBox.ProductionLineID;
  437. _rptse.GoodsTypeCode = scbGoodsType.SearchedValue + "";
  438. _rptse.GoodsCode = this.txtGoodCode.Text.Trim();
  439. _rptse.ProcedureIDS = this.dkProcedureSearchBox.ProcedureIDS;
  440. if (this.chkScrapDateStart.Checked)
  441. {
  442. _rptse.ScrapDateStart = DateTime.Parse(this.dtpScrapDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  443. _rptse.ScrapDateEnd = DateTime.Parse(this.dtpScrapDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  444. }
  445. if (this.chkPDate.Checked)
  446. {
  447. _rptse.CTimeStart = DateTime.Parse(this.dtpCDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  448. _rptse.CTimeEnd = DateTime.Parse(this.dtpCDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  449. }
  450. if (this.chkDDate.Checked)
  451. {
  452. _rptse.DTimeStart = DateTime.Parse(this.dtpDDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  453. _rptse.DTimeEnd = DateTime.Parse(this.dtpDDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  454. }
  455. if (this.chkGDate.Checked)
  456. {
  457. _rptse.GTimeStart = DateTime.Parse(this.dtpGDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  458. _rptse.GTimeEnd = DateTime.Parse(this.dtpGDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  459. }
  460. if (this.chkAuditDate.Checked)
  461. {
  462. _rptse.AuditTimeStart = DateTime.Parse(this.dtpAuditDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  463. _rptse.AuditTimeEnd = DateTime.Parse(this.dtpAuditDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  464. }
  465. _rptse.ResponProcedureIDS = this.dkResponProcedureSearchBox.ProcedureIDS;
  466. _rptse.ResponUserIDS = this.dkResponUserInfoSearchBox.UserIDS;
  467. _rptse.CreatUser = this.txtCreatUser.Text.Trim();
  468. _rptse.AuditUser = this.txtAuditUser.Text.Trim();
  469. _rptse.SpecialRepairFlag = this.chkSpecialRepairFlag.Checked;
  470. _rptse.ReFireFlag = this.chkReFireFlag.Checked;
  471. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  472. if (testMouldFlags.Length == 1)
  473. {
  474. _rptse.TestMouldFlag = testMouldFlags[0].ToString();
  475. }
  476. }
  477. /// <summary>
  478. /// 明细搜索条件
  479. /// </summary>
  480. /// <returns></returns>
  481. private void CreateSearchConditionDetail()
  482. {
  483. this._rptse = new RPT030102_SE();
  484. this._rptse.ProductionLineID = this._rptse1.ProductionLineID;
  485. this._rptse.GoodsTypeCode = this._rptse1.GoodsTypeCode;
  486. this._rptse.GoodsCode = this._rptse1.GoodsCode;
  487. this._rptse.ProcedureIDS = this._rptse1.ProcedureIDS;
  488. this._rptse.ScrapDateStart = this._rptse1.ScrapDateStart;
  489. this._rptse.ScrapDateEnd = this._rptse1.ScrapDateEnd;
  490. this._rptse.ResponProcedureIDS = this._rptse1.ResponProcedureIDS;
  491. this._rptse.ResponUserIDS = this._rptse1.ResponUserIDS;
  492. this._rptse.CreatUser = this._rptse1.CreatUser;
  493. this._rptse.AuditUser = this._rptse1.AuditUser;
  494. this._rptse.SpecialRepairFlag = this._rptse1.SpecialRepairFlag;
  495. }
  496. /// <summary>
  497. /// 查询损坏汇总表
  498. /// </summary>
  499. private DataTable GetSearchTotalData()
  500. {
  501. try
  502. {
  503. // 调用服务器端获取数据集
  504. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  505. {
  506. return ReportModuleProxy.Service.GetRPT030102SData(_rptse);
  507. }
  508. );
  509. if (sre.Status == Constant.ServiceResultStatus.Success)
  510. {
  511. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  512. {
  513. // 提示未查找到数据
  514. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  515. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  516. //清空数据
  517. return null;
  518. }
  519. return sre.Data.Tables[0];
  520. }
  521. return null;
  522. }
  523. catch (Exception ex)
  524. {
  525. throw ex;
  526. }
  527. }
  528. /// <summary>
  529. /// 查询损坏明细表
  530. /// </summary>
  531. private DataTable GetSearchDetailData()
  532. {
  533. try
  534. {
  535. // 调用服务器端获取数据集
  536. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  537. {
  538. return ReportModuleProxy.Service.GetRPT030102IData(this._rptse);
  539. }
  540. );
  541. if (sre.Status == Constant.ServiceResultStatus.Success)
  542. {
  543. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  544. {
  545. // 提示未查找到数据
  546. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  547. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  548. //清空数据
  549. return null;
  550. }
  551. return sre.Data.Tables[0];
  552. }
  553. return null;
  554. }
  555. catch (Exception ex)
  556. {
  557. throw ex;
  558. }
  559. }
  560. /// <summary>
  561. /// 获取权限
  562. /// </summary>
  563. protected void getPurview()
  564. {
  565. try
  566. {
  567. StringBuilder sbProcedurePurview = new StringBuilder();
  568. //得到工序查看权限
  569. DataSet dsProcedurePurview = (DataSet)DoAsync(new AsyncMethod(() =>
  570. {
  571. return SystemModuleProxy.Service.GetUserPurview(9, LogInUserInfo.CurrentUser.UserID);
  572. }));
  573. if (dsProcedurePurview != null)
  574. {
  575. foreach (DataRow dr in dsProcedurePurview.Tables[Constant.INT_IS_ZERO].Rows)
  576. {
  577. sbProcedurePurview.Append(dr[Constant.INT_IS_ZERO].ToString() + ",");
  578. }
  579. if (sbProcedurePurview.Length != Constant.INT_IS_ZERO)
  580. {
  581. this.dkResponProcedureSearchBox.Purview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  582. //this.dkResponProcedureSearchBox.ProcedureIDS = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  583. this._currentUserPurview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  584. }
  585. }
  586. }
  587. catch (Exception ex)
  588. {
  589. throw ex;
  590. }
  591. }
  592. /// <summary>
  593. /// 获取权限(生产线)
  594. /// </summary>
  595. protected void getPurviewLine()
  596. {
  597. try
  598. {
  599. StringBuilder sbProcedurePurview = new StringBuilder();
  600. //得到工序查看权限
  601. DataSet dsProcedurePurview = (DataSet)DoAsync(new AsyncMethod(() =>
  602. {
  603. return SystemModuleProxy.Service.GetUserPurview(7, LogInUserInfo.CurrentUser.UserID);
  604. }));
  605. if (dsProcedurePurview != null)
  606. {
  607. foreach (DataRow dr in dsProcedurePurview.Tables[Constant.INT_IS_ZERO].Rows)
  608. {
  609. sbProcedurePurview.Append(dr[Constant.INT_IS_ZERO].ToString() + ",");
  610. }
  611. if (sbProcedurePurview.Length != Constant.INT_IS_ZERO)
  612. {
  613. this.dkproductionLineSearchBox.Purview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  614. //this.dkproductionLineSearchBox.ProductionLineIDS = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  615. this._currentUserLinePuview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  616. }
  617. }
  618. }
  619. catch (Exception ex)
  620. {
  621. throw ex;
  622. }
  623. }
  624. #endregion
  625. }
  626. }