QcmJhyPassConfigCtrl.cs 3.5 KB

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