FrmProcess.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Data;
  8. using System.Linq;
  9. namespace Core.StlMes.Client.Qcm
  10. {
  11. public partial class FrmProcess : FrmBase
  12. {
  13. public FrmProcess()
  14. {
  15. InitializeComponent();
  16. ExceptionHelper.RegistException();
  17. }
  18. private OpeBase ob1;
  19. public OpeBase Ob1
  20. {
  21. get { return ob1; }
  22. set { ob1 = value; }
  23. }
  24. private string code;
  25. public string Code
  26. {
  27. get { return code; }
  28. set { code = value; }
  29. }
  30. private string desc;
  31. public string Desc
  32. {
  33. get { return desc; }
  34. set { desc = value; }
  35. }
  36. private string processStyle = "";
  37. public string ProcessStyle
  38. {
  39. get { return processStyle; }
  40. set { processStyle = value; }
  41. }
  42. //查询
  43. public void DoQuery()
  44. {
  45. DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.getSecProcess", new Object[] { processStyle }, this.Ob1);
  46. GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
  47. }
  48. /// <summary>
  49. /// 初始被选择项
  50. /// </summary>
  51. private void SetSelect()
  52. {
  53. if (desc.Equals(""))
  54. return;
  55. string[] str = desc.Split('|');
  56. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  57. {
  58. if (str.Contains(ultraGrid1.Rows[i].Cells["PROCESS_DESC_C"].Value.ToString()))
  59. {
  60. this.ultraGrid1.Rows[i].Cells["CHK"].Value = true;
  61. }
  62. }
  63. ultraGrid1.UpdateData();
  64. }
  65. private void button1_Click(object sender, EventArgs e)
  66. {
  67. ultraGrid1.UpdateData();
  68. UltraGridRow row = null;
  69. string modelcode = "";
  70. string modeldesc = "";
  71. for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  72. {
  73. row = ultraGrid1.Rows[i];
  74. if (Convert.ToBoolean(row.Cells["CHK"].Value))
  75. {
  76. if (modelcode == "")
  77. modelcode = row.Cells["PROCESS_CDOE_C"].Value.ToString();
  78. else
  79. modelcode = modelcode + "|" + row.Cells["PROCESS_CDOE_C"].Value.ToString();
  80. if (modeldesc == "")
  81. modeldesc = row.Cells["PROCESS_DESC_C"].Value.ToString();
  82. else
  83. modeldesc = modeldesc + "|" + row.Cells["PROCESS_DESC_C"].Value.ToString();
  84. }
  85. }
  86. this.Code = modelcode;
  87. this.Desc = modeldesc;
  88. this.Close();
  89. }
  90. private void button2_Click(object sender, EventArgs e)
  91. {
  92. this.Close();
  93. }
  94. private void FrmProcess_Load(object sender, EventArgs e)
  95. {
  96. DoQuery();
  97. SetSelect();
  98. }
  99. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  100. {
  101. ultraGrid1.UpdateData();
  102. }
  103. }
  104. }