StlIncisionCtrl.cs 4.0 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 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 StlIncisionCtrl : UserControl
  13. {
  14. private Dal _d;
  15. private string _customInfo="";
  16. public StlIncisionCtrl(Control container, OpeBase ob,string customInfo)
  17. {
  18. InitializeComponent();
  19. container.Controls.Add(this);
  20. this.Dock = DockStyle.Fill;
  21. this.BringToFront();
  22. this.ultraGrid1.DisplayLayout.Bands[0].Columns["stoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  23. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, false);
  24. //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
  25. DataTable dt = (DataTable)ultraComboEditor1.DataSource;
  26. for (int i = 0; i < dt.Rows.Count; i++)
  27. {
  28. if (dt.Rows[i]["BASECODE"].ToString() != "40740101"
  29. && dt.Rows[i]["BASECODE"].ToString() != "40740102")
  30. {
  31. dt.Rows[i].Delete();
  32. }
  33. }
  34. dt.AcceptChanges();
  35. ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
  36. _d = new Dal(ob);
  37. _customInfo=customInfo;
  38. }
  39. public void Query(string stoveNo, string judgeStoveNo, string state, string judgeTimeB,
  40. string judgeTimeE, string[] plines, string chemType, string gpSource, string[] plinesGp )
  41. {
  42. DataTable dt = _d.GetTableByXmlId("StlIncisionDAL.Query", stoveNo, judgeStoveNo, state,
  43. judgeTimeB, judgeTimeE, plines.Length, plines, chemType, gpSource, plinesGp.Length, plinesGp, _customInfo);
  44. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  45. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo");
  46. }
  47. public void Query(string stoveNo)
  48. {
  49. ultraGrid1.BeginUpdate();
  50. DataTable dt = _d.GetTableByXmlId("StlIncisionDAL.Query", stoveNo, "", "", "", "", "0", "", "", "", "0", "", _customInfo);
  51. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  52. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo");
  53. ultraGrid1.EndUpdate();
  54. }
  55. public void Clear()
  56. {
  57. //this.stlIncisionCtrlEntityBindingSource.Clear();
  58. }
  59. private void entityGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  60. {
  61. e.Cell.Row.Update();
  62. }
  63. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  64. {
  65. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  66. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  67. {
  68. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  69. ultraGrid1.ActiveRow.Update();
  70. }
  71. }
  72. private void entityGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
  73. {
  74. e.Layout.Override.DataErrorRowAppearance.BackColor = Color.Transparent;
  75. }
  76. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  77. {
  78. e.Cell.Row.Update();
  79. }
  80. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  81. {
  82. Color yellow = Color.FromArgb(238, 238, 0);
  83. Color red = Color.FromArgb(255, 106, 106);
  84. Color green = Color.FromArgb(60, 179, 113);
  85. if (e.Row.GetValue("judgeresultChem") == "40740102")
  86. {
  87. e.Row.RowSelectorAppearance.BackColor = red;
  88. }
  89. }
  90. }
  91. }