QcmZcCheckconsignCtrl.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 System;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Windows.Forms;
  10. namespace Core.StlMes.Client.Judge.Controls
  11. {
  12. public partial class QcmZcCheckconsignCtrl : UserControl
  13. {
  14. private OpeBase _ob;
  15. private JudgeType _judgeType;
  16. private Dal _d;
  17. public QcmZcCheckconsignCtrl(Control container, OpeBase ob, JudgeType judgeType)
  18. {
  19. InitializeComponent();
  20. this._ob = ob;
  21. _judgeType = judgeType;
  22. container.Controls.Add(this);
  23. this.Dock = DockStyle.Fill;
  24. this.BringToFront();
  25. _d = new Dal(ob);
  26. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, true);
  27. //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
  28. DataTable dt = (DataTable)ultraComboEditor1.DataSource;
  29. for (int i = 0; i < dt.Rows.Count; i++)
  30. {
  31. if (dt.Rows[i]["BASECODE"].ToString() != "40740101"
  32. && dt.Rows[i]["BASECODE"].ToString() != "40740102"
  33. && dt.Rows[i]["BASECODE"].ToString() != "")
  34. {
  35. dt.Rows[i].Delete();
  36. }
  37. }
  38. dt.AcceptChanges();
  39. ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
  40. ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407402", ob, true);
  41. DataTable dt2 = (DataTable)ultraComboEditor2.DataSource;
  42. dt2.DefaultView.RowFilter = "BASECODE IN ('40740201', '40740202') OR BASECODE IS NULL";
  43. ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false);
  44. ClsBaseInfo.FillComBaseInfo(ultraComboEditor4, "407404", ob, false);
  45. ClsBaseInfo.FillComBaseInfo(ultraComboEditor5, "407406", ob, false);
  46. }
  47. private string _steelStanrad = "";
  48. public void Query(string checkNo, string steelStanrad)
  49. {
  50. _steelStanrad = steelStanrad;
  51. DataTable dt = _d.GetTableByXmlId("JdgQcmZcCheckconsign.queryByCheckNo", checkNo);
  52. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  53. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo");
  54. }
  55. public void Clear()
  56. {
  57. dataTable1.Clear();
  58. }
  59. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  60. {
  61. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  62. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  63. {
  64. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  65. ultraGrid1.ActiveRow.Update();
  66. }
  67. }
  68. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  69. {
  70. e.Cell.Row.Update();
  71. }
  72. FormFileDown askDown;
  73. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  74. {
  75. string filePath = ultraGrid1.ActiveRow.GetValue(ultraGrid1.ActiveCell.Column.Key.Replace("craftNo", "craftPath"));
  76. askDown = new FormFileDown(_ob, filePath);
  77. askDown.DeleteButton.Visible = false;
  78. askDown.Show();
  79. }
  80. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  81. {
  82. Color yellow = Color.FromArgb(255, 246, 143);
  83. Color red = Color.FromArgb(255, 106, 106);
  84. Color green = Color.FromArgb(60, 179, 113);
  85. if (_steelStanrad.Contains("CIC"))
  86. {
  87. if (e.Row.GetValue("chemResultCode") == "40740102")
  88. {
  89. e.Row.Cells["chemResultCode"].Appearance.BackColor = red;
  90. }
  91. else if (e.Row.GetValue("chemResultCode") == "")
  92. {
  93. e.Row.Cells["chemResultCode"].Appearance.BackColor = yellow;
  94. }
  95. }
  96. if (_steelStanrad.Contains("PIC"))
  97. {
  98. if (e.Row.GetValue("phyResultCode") == "40740202")
  99. {
  100. e.Row.Cells["phyResultCode"].Appearance.BackColor = red;
  101. }
  102. else if (e.Row.GetValue("phyResultCode") == "")
  103. {
  104. e.Row.Cells["phyResultCode"].Appearance.BackColor = yellow;
  105. }
  106. }
  107. if (e.Row.GetValue("judgeResultCode") == "40740704")
  108. {
  109. e.Row.Cells["judgeResultName"].Appearance.BackColor = red;
  110. }
  111. else if (e.Row.GetValue("judgeResultCode") == "")
  112. {
  113. e.Row.Cells["judgeResultName"].Appearance.BackColor = yellow;
  114. }
  115. }
  116. }
  117. }