MscStandPayN.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using CoreFS.CA06;
  2. using Infragistics.Win.UltraWinEditors;
  3. using Infragistics.Win.UltraWinGrid;
  4. namespace Core.StlMes.Client.Qcm
  5. {
  6. public partial class MscStandPayN : FrmBase
  7. {
  8. public MscStandPayN(string strIc, string standPayKey, OpeBase ob)
  9. {
  10. InitializeComponent();
  11. ComStandPay standPay = new ComStandPay("2", ob);
  12. standPay.CkbDeleteFilter = this.checkBox1;
  13. standPay.TabChemStand = this.panel1;
  14. standPay.TabComMSCStdDetection = this.panel1;
  15. standPay.TabMaterialStand = this.panel1;
  16. standPay.TabProductWater = this.panel1;
  17. standPay.TabTolerancesStand = this.panel1;
  18. standPay.TabComMSCStdProcess = this.panel1;
  19. string[] strAry = new string[2];
  20. strAry[0] = "ultraGrid1";
  21. switch (standPayKey)
  22. {
  23. case "ChemStand":
  24. strAry[1] = "ultraCheckValid";
  25. standPay.SaveStandPay("2", standPayKey, strAry);
  26. standPay.LoadStandPay("2", standPayKey);
  27. standPay.SetIcContidition(strIc, standPayKey);
  28. standPay.QueryChemStandWithOutFilter();
  29. standPay.ExpandChemStandGrid();
  30. break;
  31. case "ComMSCStdDetection":
  32. strAry[1] = "ultraCheckValid";
  33. standPay.SaveStandPay("2", standPayKey, strAry);
  34. standPay.LoadStandPay("2", standPayKey);
  35. standPay.SetIcContidition(strIc, standPayKey);
  36. standPay.QueryComMSCStdDetectionWithOutFilter();
  37. standPay.ExpandComMSCStdDetectionGrid();
  38. break;
  39. case "MaterialStand":
  40. strAry[1] = "ultraCheckEditor2";
  41. standPay.SaveStandPay("2", standPayKey, strAry);
  42. standPay.LoadStandPay("2", standPayKey);
  43. standPay.SetIcContidition(strIc, standPayKey);
  44. standPay.QueryMaterialStandWithOutFilter();
  45. standPay.ExpandMaterialStandGrid();
  46. break;
  47. case "ProductWater":
  48. strAry[1] = "ultraCheckValid";
  49. standPay.SaveStandPay("2", standPayKey, strAry);
  50. standPay.LoadStandPay("2", standPayKey);
  51. standPay.SetIcContidition(strIc, standPayKey);
  52. standPay.QueryProductWaterWithOutFilter();
  53. standPay.ExpandProductWaterGrid();
  54. break;
  55. case "TolerancesStand":
  56. strAry[1] = "chkValid";
  57. standPay.SaveStandPay("2", standPayKey, strAry);
  58. standPay.LoadStandPay("2", standPayKey);
  59. standPay.SetIcContidition(strIc, standPayKey);
  60. standPay.QueryTolerancesStandWithOutFilter();
  61. standPay.ExpandTolerancesStandGrid();
  62. break;
  63. case "ComMSCStdProcess":
  64. strAry[1] = "ultraCheckValid";
  65. standPay.SaveStandPay("2", standPayKey, strAry);
  66. standPay.LoadStandPay("2", standPayKey);
  67. standPay.SetIcContidition(strIc, standPayKey);
  68. standPay.QueryComMSCStdProcessWithOutFilter();
  69. standPay.ExpandComMSCStdProcess();
  70. break;
  71. }
  72. SetGrid();
  73. }
  74. private void SetGrid()
  75. {
  76. System.Windows.Forms.Control[] controls = panel1.Controls.Find("ultraGrid1", true);
  77. foreach (System.Windows.Forms.Control control in controls)
  78. {
  79. if (control is UltraGrid)
  80. {
  81. UltraGrid grid = (UltraGrid)control;
  82. foreach (UltraGridBand band in grid.DisplayLayout.Bands)
  83. {
  84. band.Override.AllowAddNew = AllowAddNew.No;
  85. foreach (UltraGridColumn column in band.Columns)
  86. {
  87. if (column.Key == "CHC")
  88. {
  89. column.Hidden = true;
  90. }
  91. else
  92. {
  93. if (column.EditorComponent is UltraComboEditor)
  94. {
  95. column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
  96. }
  97. column.CellActivation = Activation.ActivateOnly;
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }