F_RPT_030102_1.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  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. }
  115. catch (Exception ex)
  116. {
  117. // 对异常进行共通处理
  118. ExceptionManager.HandleEventException(this.ToString(),
  119. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  120. }
  121. }
  122. /// <summary>
  123. /// 窗体关闭事件
  124. /// </summary>
  125. /// <param name="sender"></param>
  126. /// <param name="e"></param>
  127. private void F_RPT_030102_1_FormClosed(object sender, FormClosedEventArgs e)
  128. {
  129. _instance = null;
  130. }
  131. /// <summary>
  132. /// 关闭按钮
  133. /// </summary>
  134. /// <param name="sender"></param>
  135. /// <param name="e"></param>
  136. private void tsbtnClose_Click(object sender, EventArgs e)
  137. {
  138. this.Close();
  139. }
  140. /// <summary>
  141. /// 自动适应列宽
  142. /// </summary>
  143. /// <param name="sender"></param>
  144. /// <param name="e"></param>
  145. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  146. {
  147. if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ZERO)
  148. {
  149. this.dgvScrapTotalModule.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  150. }
  151. else
  152. {
  153. this.dgvScrapTotalModuleDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  154. }
  155. }
  156. /// <summary>
  157. /// 查询按钮事件
  158. /// </summary>
  159. /// <param name="sender"></param>
  160. /// <param name="e"></param>
  161. private void btnSearch_Click(object sender, EventArgs e)
  162. {
  163. try
  164. {
  165. CreateSearchCondition();
  166. if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ZERO)//产品损坏汇总查询
  167. {
  168. this._rptse1 = this._rptse;
  169. this.dgvScrapTotalModule.DataSource = null;
  170. this.dgvScrapTotalModule.DataSource = this.GetSearchTotalData();
  171. }
  172. else //产品损坏明细查询
  173. {
  174. this.dgvScrapTotalModuleDetail.DataSource = null;
  175. this.dgvScrapTotalModuleDetail.DataSource = this.GetSearchDetailData();
  176. }
  177. }
  178. catch (Exception ex)
  179. {
  180. this.btnSearch.Enabled = true;
  181. // 对异常进行共通处理
  182. ExceptionManager.HandleEventException(this.ToString(),
  183. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  184. }
  185. }
  186. /// <summary>
  187. /// 清空条件按钮事件
  188. /// </summary>
  189. /// <param name="sender"></param>
  190. /// <param name="e"></param>
  191. private void btnClearCondition_Click(object sender, EventArgs e)
  192. {
  193. this.dkproductionLineSearchBox.ClearControl();
  194. this.scbGoodsType.ClearValue();
  195. this.txtGoodCode.Clear();
  196. this.dkProcedureSearchBox.ClearControl();
  197. this.dtpScrapDateStart.Value = DateTime.Now.Date;
  198. this.dtpScrapDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  199. this.chkScrapDateStart.Checked = true;
  200. this.dkResponProcedureSearchBox.ClearControl();
  201. this.dkResponUserInfoSearchBox.ClearControl();
  202. //this.dkResponProcedureSearchBox.ProcedureIDS = this._currentUserPurview;
  203. //this.dkproductionLineSearchBox.ProductionLineIDS = this._currentUserLinePuview;
  204. this.txtAuditUser.Clear();
  205. this.txtCreatUser.Clear();
  206. this.chkSpecialRepairFlag.Checked = true;
  207. this.chkReFireFlag.Checked = false;
  208. // 完成时间
  209. this.dtpCDateStart.Value = DateTime.Now.Date;
  210. this.dtpCDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  211. this.dtpCDateStart.Enabled = false;
  212. this.dtpCDateEnd.Enabled = false;
  213. this.chkPDate.Checked = false;
  214. // 交坯时间
  215. this.dtpDDateStart.Value = DateTime.Now.Date;
  216. this.dtpDDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  217. this.dtpDDateStart.Enabled = false;
  218. this.dtpDDateEnd.Enabled = false;
  219. this.chkDDate.Checked = false;
  220. // 注浆时间
  221. this.dtpGDateStart.Value = DateTime.Now.Date;
  222. this.dtpGDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  223. this.dtpGDateStart.Enabled = false;
  224. this.dtpGDateEnd.Enabled = false;
  225. this.chkGDate.Checked = false;
  226. // 审核时间
  227. this.dtpAuditDateStart.Value = DateTime.Now.Date;
  228. this.dtpAuditDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  229. this.dtpAuditDateStart.Enabled = false;
  230. this.dtpAuditDateEnd.Enabled = false;
  231. this.chkAuditDate.Checked = false;
  232. }
  233. /// <summary>
  234. /// 双击单元格事件
  235. /// </summary>
  236. /// <param name="sender"></param>
  237. /// <param name="e"></param>
  238. private void dgvScrapTotalModule_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  239. {
  240. try
  241. {
  242. //判断是否为空
  243. if (this.dgvScrapTotalModule.CurrentRow == null)
  244. {
  245. return;
  246. }
  247. //获取数据信息
  248. DataGridViewRow dgvr = dgvScrapTotalModule.CurrentRow;
  249. string zruserid = dgvr.Cells["zruserid"].Value.ToString();
  250. string goodsId = dgvr.Cells["GoodsId"].Value.ToString();
  251. string goodstypecode2 = dgvr.Cells["GoodsTypeCode2"].Value.ToString();
  252. string zrprocedureId = dgvr.Cells["ZRProcedureId"].Value.ToString();
  253. string productionlineid = dgvr.Cells["productionlineid"].Value.ToString();
  254. //判断是否选择统计行
  255. //if (!goodsCode.Equals("--"))
  256. //{
  257. // this.tblScrapTotalModule.SelectTab(1);
  258. // //获取查询条件
  259. // //CreateSearchCondition();
  260. // this.rptse1.GoodsIDS = goodsId.ToString();
  261. // //获取工序id
  262. // if (string.IsNullOrEmpty(procedureId))
  263. // {
  264. // this.rptse1.ResponProcedureID = 0;
  265. // }
  266. // else
  267. // {
  268. // this.rptse1.ResponProcedureID = Convert.ToInt32(procedureId);
  269. // }
  270. // this.dgvScrapTotalModuleDetail.DataSource = null;
  271. // this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData(this.rptse1);
  272. //}
  273. if (!string.IsNullOrEmpty(goodsId))
  274. {
  275. this.dgvScrapTotalModuleDetail.DataSource = null;
  276. this.tblScrapTotalModule.SelectTab(1);
  277. //获取条件
  278. this.CreateSearchConditionDetail();
  279. this._rptse.GoodsID = goodsId;
  280. this._rptse.ResponProcedureID = zrprocedureId;
  281. this._rptse.ResponUserID = zruserid;
  282. this.dgvScrapTotalModuleDetail.DataSource = null;
  283. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  284. return;
  285. }
  286. if (!string.IsNullOrEmpty(goodstypecode2))
  287. {
  288. this.dgvScrapTotalModuleDetail.DataSource = null;
  289. this.tblScrapTotalModule.SelectTab(1);
  290. //获取条件
  291. this.CreateSearchConditionDetail();
  292. this._rptse.ResponProcedureID = zrprocedureId;
  293. this._rptse.GoodsTypeCode = goodstypecode2;
  294. this.dgvScrapTotalModuleDetail.DataSource = null;
  295. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  296. return;
  297. }
  298. if (!string.IsNullOrEmpty(productionlineid))
  299. {
  300. this.dgvScrapTotalModuleDetail.DataSource = null;
  301. this.tblScrapTotalModule.SelectTab(1);
  302. //获取条件
  303. this.CreateSearchConditionDetail();
  304. this._rptse.ResponProcedureID = zrprocedureId;
  305. this.dgvScrapTotalModuleDetail.DataSource = null;
  306. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  307. return;
  308. }
  309. this.dgvScrapTotalModuleDetail.DataSource = null;
  310. this.tblScrapTotalModule.SelectTab(1);
  311. //获取条件
  312. this.CreateSearchConditionDetail();
  313. this.dgvScrapTotalModuleDetail.DataSource = null;
  314. this.dgvScrapTotalModuleDetail.DataSource = GetSearchDetailData();
  315. }
  316. catch (Exception ex)
  317. {
  318. this.btnSearch.Enabled = true;
  319. this.btnClearCondition.Enabled = true;
  320. // 对异常进行共通处理
  321. ExceptionManager.HandleEventException(this.ToString(),
  322. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  323. }
  324. }
  325. /// <summary>
  326. /// 报损日期选中改变事件
  327. /// </summary>
  328. /// <param name="sender"></param>
  329. /// <param name="e"></param>
  330. private void chkScrapDateStart_CheckedChanged(object sender, EventArgs e)
  331. {
  332. if (this.chkScrapDateStart.Checked)
  333. {
  334. this.dtpScrapDateStart.Enabled = true;
  335. this.dtpScrapDateEnd.Enabled = true;
  336. }
  337. else
  338. {
  339. this.dtpScrapDateStart.Enabled = false;
  340. this.dtpScrapDateEnd.Enabled = false;
  341. this.dtpScrapDateStart.Value = DateTime.Now.Date;
  342. this.dtpScrapDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  343. }
  344. }
  345. /// <summary>
  346. /// 完成时间选中改变事件
  347. /// </summary>
  348. /// <param name="sender"></param>
  349. /// <param name="e"></param>
  350. private void chkPDate_CheckedChanged(object sender, EventArgs e)
  351. {
  352. if (this.chkPDate.Checked)
  353. {
  354. this.dtpCDateStart.Enabled = true;
  355. this.dtpCDateEnd.Enabled = true;
  356. }
  357. else
  358. {
  359. this.dtpCDateStart.Enabled = false;
  360. this.dtpCDateEnd.Enabled = false;
  361. this.dtpCDateStart.Value = DateTime.Now.Date;
  362. this.dtpCDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  363. }
  364. }
  365. /// <summary>
  366. /// 交坯时间选中改变事件
  367. /// </summary>
  368. /// <param name="sender"></param>
  369. /// <param name="e"></param>
  370. private void chkDDate_CheckedChanged(object sender, EventArgs e)
  371. {
  372. if (this.chkDDate.Checked)
  373. {
  374. this.dtpDDateStart.Enabled = true;
  375. this.dtpDDateEnd.Enabled = true;
  376. }
  377. else
  378. {
  379. this.dtpDDateStart.Enabled = false;
  380. this.dtpDDateEnd.Enabled = false;
  381. this.dtpDDateStart.Value = DateTime.Now.Date;
  382. this.dtpDDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  383. }
  384. }
  385. /// <summary>
  386. /// 注浆时间选中改变事件
  387. /// </summary>
  388. /// <param name="sender"></param>
  389. /// <param name="e"></param>
  390. private void chkGDate_CheckedChanged(object sender, EventArgs e)
  391. {
  392. if (this.chkGDate.Checked)
  393. {
  394. this.dtpGDateStart.Enabled = true;
  395. this.dtpGDateEnd.Enabled = true;
  396. }
  397. else
  398. {
  399. this.dtpGDateStart.Enabled = false;
  400. this.dtpGDateEnd.Enabled = false;
  401. this.dtpGDateStart.Value = DateTime.Now.Date;
  402. this.dtpGDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  403. }
  404. }
  405. /// <summary>
  406. /// 审核日期
  407. /// </summary>
  408. /// <param name="sender"></param>
  409. /// <param name="e"></param>
  410. private void chkAuditDate_CheckedChanged(object sender, EventArgs e)
  411. {
  412. if (this.chkAuditDate.Checked)
  413. {
  414. this.dtpAuditDateStart.Enabled = true;
  415. this.dtpAuditDateEnd.Enabled = true;
  416. }
  417. else
  418. {
  419. this.dtpAuditDateStart.Enabled = false;
  420. this.dtpAuditDateEnd.Enabled = false;
  421. this.dtpAuditDateStart.Value = DateTime.Now.Date;
  422. this.dtpAuditDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  423. }
  424. }
  425. #endregion
  426. #region 私有方法
  427. /// <summary>
  428. /// 搜索条件
  429. /// </summary>
  430. /// <returns></returns>
  431. private void CreateSearchCondition()
  432. {
  433. _rptse = new RPT030102_SE();
  434. _rptse.ProductionLineID = this.dkproductionLineSearchBox.ProductionLineID;
  435. _rptse.GoodsTypeCode = scbGoodsType.SearchedValue + "";
  436. _rptse.GoodsCode = this.txtGoodCode.Text.Trim();
  437. _rptse.ProcedureIDS = this.dkProcedureSearchBox.ProcedureIDS;
  438. if (this.chkScrapDateStart.Checked)
  439. {
  440. _rptse.ScrapDateStart = DateTime.Parse(this.dtpScrapDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  441. _rptse.ScrapDateEnd = DateTime.Parse(this.dtpScrapDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  442. }
  443. if (this.chkPDate.Checked)
  444. {
  445. _rptse.CTimeStart = DateTime.Parse(this.dtpCDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  446. _rptse.CTimeEnd = DateTime.Parse(this.dtpCDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  447. }
  448. if (this.chkDDate.Checked)
  449. {
  450. _rptse.DTimeStart = DateTime.Parse(this.dtpDDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  451. _rptse.DTimeEnd = DateTime.Parse(this.dtpDDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  452. }
  453. if (this.chkGDate.Checked)
  454. {
  455. _rptse.GTimeStart = DateTime.Parse(this.dtpGDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  456. _rptse.GTimeEnd = DateTime.Parse(this.dtpGDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  457. }
  458. if (this.chkAuditDate.Checked)
  459. {
  460. _rptse.AuditTimeStart = DateTime.Parse(this.dtpAuditDateStart.Value.ToString("yyyy-MM-dd HH:mm") + ":00");
  461. _rptse.AuditTimeEnd = DateTime.Parse(this.dtpAuditDateEnd.Value.ToString("yyyy-MM-dd HH:mm") + ":59");
  462. }
  463. _rptse.ResponProcedureIDS = this.dkResponProcedureSearchBox.ProcedureIDS;
  464. _rptse.ResponUserIDS = this.dkResponUserInfoSearchBox.UserIDS;
  465. _rptse.CreatUser = this.txtCreatUser.Text.Trim();
  466. _rptse.AuditUser = this.txtAuditUser.Text.Trim();
  467. _rptse.SpecialRepairFlag = this.chkSpecialRepairFlag.Checked;
  468. _rptse.ReFireFlag = this.chkReFireFlag.Checked;
  469. }
  470. /// <summary>
  471. /// 明细搜索条件
  472. /// </summary>
  473. /// <returns></returns>
  474. private void CreateSearchConditionDetail()
  475. {
  476. this._rptse = new RPT030102_SE();
  477. this._rptse.ProductionLineID = this._rptse1.ProductionLineID;
  478. this._rptse.GoodsTypeCode = this._rptse1.GoodsTypeCode;
  479. this._rptse.GoodsCode = this._rptse1.GoodsCode;
  480. this._rptse.ProcedureIDS = this._rptse1.ProcedureIDS;
  481. this._rptse.ScrapDateStart = this._rptse1.ScrapDateStart;
  482. this._rptse.ScrapDateEnd = this._rptse1.ScrapDateEnd;
  483. this._rptse.ResponProcedureIDS = this._rptse1.ResponProcedureIDS;
  484. this._rptse.ResponUserIDS = this._rptse1.ResponUserIDS;
  485. this._rptse.CreatUser = this._rptse1.CreatUser;
  486. this._rptse.AuditUser = this._rptse1.AuditUser;
  487. this._rptse.SpecialRepairFlag = this._rptse1.SpecialRepairFlag;
  488. }
  489. /// <summary>
  490. /// 查询损坏汇总表
  491. /// </summary>
  492. private DataTable GetSearchTotalData()
  493. {
  494. try
  495. {
  496. // 调用服务器端获取数据集
  497. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  498. {
  499. return ReportModuleProxy.Service.GetRPT030102SData(_rptse);
  500. }
  501. );
  502. if (sre.Status == Constant.ServiceResultStatus.Success)
  503. {
  504. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  505. {
  506. // 提示未查找到数据
  507. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  508. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  509. //清空数据
  510. return null;
  511. }
  512. return sre.Data.Tables[0];
  513. }
  514. return null;
  515. }
  516. catch (Exception ex)
  517. {
  518. throw ex;
  519. }
  520. }
  521. /// <summary>
  522. /// 查询损坏明细表
  523. /// </summary>
  524. private DataTable GetSearchDetailData()
  525. {
  526. try
  527. {
  528. // 调用服务器端获取数据集
  529. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  530. {
  531. return ReportModuleProxy.Service.GetRPT030102IData(this._rptse);
  532. }
  533. );
  534. if (sre.Status == Constant.ServiceResultStatus.Success)
  535. {
  536. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  537. {
  538. // 提示未查找到数据
  539. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  540. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  541. //清空数据
  542. return null;
  543. }
  544. return sre.Data.Tables[0];
  545. }
  546. return null;
  547. }
  548. catch (Exception ex)
  549. {
  550. throw ex;
  551. }
  552. }
  553. /// <summary>
  554. /// 获取权限
  555. /// </summary>
  556. protected void getPurview()
  557. {
  558. try
  559. {
  560. StringBuilder sbProcedurePurview = new StringBuilder();
  561. //得到工序查看权限
  562. DataSet dsProcedurePurview = (DataSet)DoAsync(new AsyncMethod(() =>
  563. {
  564. return SystemModuleProxy.Service.GetUserPurview(9, LogInUserInfo.CurrentUser.UserID);
  565. }));
  566. if (dsProcedurePurview != null)
  567. {
  568. foreach (DataRow dr in dsProcedurePurview.Tables[Constant.INT_IS_ZERO].Rows)
  569. {
  570. sbProcedurePurview.Append(dr[Constant.INT_IS_ZERO].ToString() + ",");
  571. }
  572. if (sbProcedurePurview.Length != Constant.INT_IS_ZERO)
  573. {
  574. this.dkResponProcedureSearchBox.Purview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  575. //this.dkResponProcedureSearchBox.ProcedureIDS = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  576. this._currentUserPurview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  577. }
  578. }
  579. }
  580. catch (Exception ex)
  581. {
  582. throw ex;
  583. }
  584. }
  585. /// <summary>
  586. /// 获取权限(生产线)
  587. /// </summary>
  588. protected void getPurviewLine()
  589. {
  590. try
  591. {
  592. StringBuilder sbProcedurePurview = new StringBuilder();
  593. //得到工序查看权限
  594. DataSet dsProcedurePurview = (DataSet)DoAsync(new AsyncMethod(() =>
  595. {
  596. return SystemModuleProxy.Service.GetUserPurview(7, LogInUserInfo.CurrentUser.UserID);
  597. }));
  598. if (dsProcedurePurview != null)
  599. {
  600. foreach (DataRow dr in dsProcedurePurview.Tables[Constant.INT_IS_ZERO].Rows)
  601. {
  602. sbProcedurePurview.Append(dr[Constant.INT_IS_ZERO].ToString() + ",");
  603. }
  604. if (sbProcedurePurview.Length != Constant.INT_IS_ZERO)
  605. {
  606. this.dkproductionLineSearchBox.Purview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  607. //this.dkproductionLineSearchBox.ProductionLineIDS = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  608. this._currentUserLinePuview = sbProcedurePurview.ToString().Substring(Constant.INT_IS_ZERO, sbProcedurePurview.Length - 1);
  609. }
  610. }
  611. }
  612. catch (Exception ex)
  613. {
  614. throw ex;
  615. }
  616. }
  617. #endregion
  618. }
  619. }