QcmBcPassConfigCtrl.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.StlMes.Client.Judge.Commons;
  4. using Core.StlMes.Client.Judge.Forms;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Data;
  9. using System.Windows.Forms;
  10. using Infragistics.Win;
  11. namespace Core.StlMes.Client.Judge.Controls
  12. {
  13. public partial class QcmBcPassConfigCtrl : UserControl
  14. {
  15. private Dal _d;
  16. public QcmBcPassConfigCtrl(Control container, OpeBase ob)
  17. {
  18. InitializeComponent();
  19. container.Controls.Add(this);
  20. this.Dock = DockStyle.Fill;
  21. this.BringToFront();
  22. _d = new Dal(ob);
  23. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407407", ob, false);
  24. DataTable dt = (DataTable)ultraComboEditor1.DataSource;
  25. dt.DefaultView.RowFilter = "BASECODE IN ('40740704', '40740708', '0')";
  26. DataRow dr = dt.NewRow();
  27. dr["BASECODE"] = "0";
  28. dr["BASENAME"] = "未判";
  29. dt.Rows.InsertAt(dr, 0);
  30. DataTable dtProcess = _d.GetTableByXmlId("JdgComBaseProcess.QueryProcessInfo");
  31. ultraComboEditor2.DisplayMember = "processDesc";
  32. ultraComboEditor2.ValueMember = "processCode";
  33. dtProcess.DefaultView.RowFilter = "processCode in ('D', 'E', 'F', 'G', '0') ";
  34. DataRow drProcess = dtProcess.NewRow();
  35. drProcess["processCode"] = "0";
  36. drProcess["processDesc"] = "成品";
  37. dtProcess.Rows.InsertAt(drProcess, 0);
  38. ultraComboEditor2.DataSource = dtProcess;
  39. ValueList list = new ValueList();
  40. ValueListItem[] items = new ValueListItem[] {
  41. new ValueListItem("0", "天管"),
  42. new ValueListItem("1", "天淮"),
  43. };
  44. list.ValueListItems.AddRange(items);
  45. ultraGrid1.DisplayLayout.Bands[0].Columns["seamArea"].ValueList = list;
  46. }
  47. public void Query()
  48. {
  49. DataTable dt = _d.GetTableByXmlId("JdgQcmBcPassConfig.Query");
  50. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  51. //GridHelper.RefreshAndAutoSize(ultraGrid1);
  52. foreach (var row in ultraGrid1.Rows)
  53. {
  54. ControlEdit(row);
  55. }
  56. }
  57. private void ControlEdit(UltraGridRow row)
  58. {
  59. if (row.GetValue("auditStep") == "")
  60. {
  61. row.Cells["judgeResult"].Activation = Activation.AllowEdit;
  62. row.Cells["type"].Activation = Activation.AllowEdit;
  63. }
  64. else
  65. {
  66. row.Cells["judgeResult"].Activation = Activation.ActivateOnly;
  67. row.Cells["type"].Activation = Activation.ActivateOnly;
  68. }
  69. }
  70. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  71. {
  72. var row = ultraGrid1.ActiveRow;
  73. DataTable dt = _d.GetTableByXmlId("JdgCoreAppDepartment.Query");
  74. dt.Columns["unitDesc"].Caption = "审核科室";
  75. dt.Columns["departDesc"].Caption = "审核部门";
  76. BaseInfoPopup popup = new BaseInfoPopup(dt, "unitDesc", "unitCode");
  77. popup.LabelTextBox1.Caption = "审核科室";
  78. if (popup.ShowDialog() == DialogResult.OK)
  79. {
  80. row.SetValue("auditUnit", popup.ChoicedRow.GetValue("unitCode"));
  81. row.SetValue("auditUnitDesc", popup.ChoicedRow.GetValue("unitDesc"));
  82. row.SetValue("auditDepart", popup.ChoicedRow.GetValue("departDesc"));
  83. row.Update();
  84. }
  85. }
  86. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  87. {
  88. e.Cell.Row.Update();
  89. ControlEdit(e.Cell.Row);
  90. }
  91. }
  92. }