FrmRunTimeRpt.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Windows.Forms;
  6. using Core.Mes.Client.Comm.Control;
  7. using Core.Mes.Client.Comm.Tool;
  8. using Core.StlMes.Client.Mcp.Treatment.Entity;
  9. using CoreFS.CA06;
  10. namespace Core.StlMes.Client.Mcp.Treatment.Report
  11. {
  12. public partial class FrmRunTimeRpt : FrmBase
  13. {
  14. public FrmRunTimeRpt()
  15. {
  16. InitializeComponent();
  17. this.IsLoadUserView = true;
  18. }
  19. private string[] plineCodes = null;
  20. protected override void OnLoad(EventArgs e)
  21. {
  22. base.OnLoad(e);
  23. plineCodes = comm.InitDropPlinePower("F", cboPline, this.ValidDataPurviewIds, ob);
  24. EntityHelper.ShowGridCaption<MchRunEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  25. comm.RefreshAndAutoSizeWithHeader(ultraGrid1);
  26. dtBathYear.Value = DateTime.Now;
  27. }
  28. public override void ToolBar_Click(object sender, string ToolbarKey)
  29. {
  30. switch (ToolbarKey)
  31. {
  32. case "Query":
  33. Query();
  34. break;
  35. case "Export":
  36. Export();
  37. break;
  38. case "Close":
  39. this.Close();
  40. break;
  41. }
  42. }
  43. private void Export()
  44. {
  45. string title = "";
  46. title += "管加工半成品收发存" + dtBathYear.Value.ToString("yyyyMM");
  47. GridHelper.ulGridToExcel(ultraGrid1, title);
  48. }
  49. private void Query()
  50. {
  51. WaitingForm2 wf = new WaitingForm2("正在查询,请稍候....");
  52. try
  53. {
  54. this.Cursor = Cursors.WaitCursor;
  55. var CurrentlistEntity =
  56. EntityHelper.GetData<MchRunEntity>( "com.steering.mes.mcp.common.FrmHttRunTimeRpt.doQuery",
  57. new object[]
  58. {
  59. dtBathYear.Value.ToString("yyyyMM"),
  60. ucePlineCode.Checked && cboPline.CheckedItems.Count > 0
  61. ? cboPline.CheckedItems.Select(p => p.DataValue.ToString()).ToArray()
  62. : plineCodes,
  63. uceJudgeStove.Checked?txtJudgeStove.Text:""
  64. }, ob);
  65. ydmHttInitialEntityPlusBindingSource.DataSource = CurrentlistEntity;
  66. comm.RefreshAndAutoSizeWithHeader(ultraGrid1, new string[] { "" });
  67. }
  68. catch (Exception)
  69. {
  70. }
  71. finally
  72. {
  73. wf.Close();
  74. this.Cursor = Cursors.Default;
  75. }
  76. }
  77. }
  78. }