FrmHttInitialRpt.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using Core.Mes.Client.Comm.Control;
  6. using Core.Mes.Client.Comm.Format;
  7. using Core.Mes.Client.Comm.Tool;
  8. using Core.StlMes.Client.Mcp.Treatment.Entity;
  9. using CoreFS.CA06;
  10. using Infragistics.Win.UltraWinEditors;
  11. namespace Core.StlMes.Client.Mcp.Treatment.Report
  12. {
  13. public partial class FrmHttInitialRpt : FrmBase
  14. {
  15. public FrmHttInitialRpt()
  16. {
  17. InitializeComponent();
  18. this.IsLoadUserView = true;
  19. }
  20. private string balMonth = "";
  21. private string[] plineCodes = null;
  22. private string ProcessCode = "";
  23. private List<YdmHttInitialEntity2> CurrentlistEntity;
  24. protected override void OnLoad(EventArgs e)
  25. {
  26. base.OnLoad(e);
  27. ProcessCode = this.CustomInfo.ToString2();
  28. if (ProcessCode == "") ProcessCode = "F";
  29. plineCodes = comm.InitDropPlinePower(ProcessCode, cboPline, this.ValidDataPurviewIds, ob);
  30. comm.InitDroProStation(ProcessCode, new List<UltraComboEditor>() { uceFactory }, this.ValidDataPurviewIds, ob);
  31. if (plineCodes == null || plineCodes.Length <= 0)
  32. {
  33. MessageBox.Show("无数据权限!");
  34. this.Close();
  35. }
  36. comm.RefreshAndAutoSizeWithHeader(ultraGrid1);
  37. dtBathYear.Value = DateTime.Now;
  38. EntityHelper.ShowGridCaption<YdmHttInitialEntity2>(ultraGrid1.DisplayLayout.Bands[0]);
  39. GridHelper.SetAllColumnsActive(ultraGrid1);
  40. }
  41. public override void ToolBar_Click(object sender, string ToolbarKey)
  42. {
  43. switch (ToolbarKey)
  44. {
  45. case "Query":
  46. Query();
  47. break;
  48. case "Export":
  49. GridHelper.ulGridToExcel(ultraGrid1, "在产品期初报表");
  50. break;
  51. case "Close":
  52. this.Close();
  53. break;
  54. }
  55. }
  56. private void Query()
  57. {
  58. WaitingForm2 wf = new WaitingForm2("正在查询,请稍候....");
  59. try
  60. {
  61. this.Cursor = Cursors.WaitCursor;
  62. ultraGrid1.DataSource =
  63. EntityHelper.GetData<YdmHttInitialEntity2>("com.steering.mes.mcp.common.FrmHttInitialRpt.doQuery",
  64. new object[]
  65. {
  66. dtBathYear.Value.ToString("yyyyMM"),
  67. ucePlineCode.Checked && cboPline.CheckedItems.Count > 0
  68. ? cboPline.CheckedItems.Select(p => p.DataValue.ToString()).ToArray()
  69. : plineCodes,
  70. chkFactory.Checked && uceFactory.SelectedIndex >= 0
  71. ? uceFactory.SelectedItem.DataValue.ToString()
  72. : "",
  73. chkType.Checked && uceType.SelectedIndex >= 0
  74. ? uceType.SelectedItem.DataValue.ToString()
  75. : "",
  76. uceJudgeStove.Checked?txtJudgeStove.Text:""
  77. }, ob);
  78. }
  79. catch (Exception)
  80. {
  81. }
  82. finally
  83. {
  84. wf.Close();
  85. this.Cursor = Cursors.Default;
  86. }
  87. }
  88. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  89. {
  90. /* YdmHttInitialEntityPlus entity = e.Row.ListObject as YdmHttInitialEntityPlus;
  91. if (entity.SourceNumTotal + entity.ActCount != entity.FailNum + entity.GroupNum + entity.EndNum + entity.JudgeNum)
  92. {
  93. e.Row.Appearance.BackColor = Color.Red;
  94. }*/
  95. }
  96. }
  97. }