FinalCheckInfoCtrl.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.StlMes.Client.Judge.Commons;
  3. using CoreFS.CA06;
  4. using Infragistics.Win;
  5. using System;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Windows.Forms;
  9. namespace Core.StlMes.Client.Judge.Controls
  10. {
  11. public partial class FinalCheckInfoCtrl : UserControl
  12. {
  13. private Dal _d;
  14. public FinalCheckInfoCtrl(Control container, OpeBase ob)
  15. {
  16. InitializeComponent();
  17. _d = new Dal(ob);
  18. container.Controls.Add(this);
  19. this.Dock = DockStyle.Fill;
  20. ValueList stationList = new ValueList();
  21. stationList.ValueListItems.Add("0", "合格");
  22. stationList.ValueListItems.Add("1", "不合格");
  23. stationList.ValueListItems.Add("2", "废品");
  24. stationList.ValueListItems.Add("3", "扩检");
  25. ultraGrid2.DisplayLayout.Bands[0].Columns["station"].ValueList = stationList;
  26. ValueList replayStationList = new ValueList();
  27. replayStationList.ValueListItems.Add("0", "合格");
  28. replayStationList.ValueListItems.Add("2", "废品");
  29. ultraGrid2.DisplayLayout.Bands[0].Columns["replayStation"].ValueList = replayStationList;
  30. }
  31. public void Query(string judgeStoveNo, string batchNo, string plineCode, bool clearData)
  32. {
  33. dataTable2.Clear();
  34. DataTable dt = _d.GetTableByXmlId("JdgMchFinalChekResult.getInfo", judgeStoveNo, batchNo, plineCode);
  35. GridHelper.CopyDataToDatatable(dt, dataTable1, clearData);
  36. foreach (DataRow row in dataTable1.Rows)
  37. {
  38. if (row["batchNo"].ToString() != "") continue;
  39. row["judgeStoveNo"] = judgeStoveNo;
  40. row["batchNo"] = batchNo;
  41. }
  42. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "reportPath");
  43. }
  44. public void ClearData()
  45. {
  46. this.dataTable1.Clear();
  47. this.dataTable2.Clear();
  48. }
  49. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  50. {
  51. string filePath = ultraGrid1.ActiveRow.GetValue("reportPath");
  52. FormFileDown formFile = new FormFileDown(_d.Ob, filePath);
  53. formFile.DeleteButton.Visible = false;
  54. formFile.Show();
  55. }
  56. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  57. {
  58. var resultRow = ultraGrid1.ActiveRow;
  59. string resultNo = resultRow.GetValue("resultNo");
  60. DataTable dt = _d.GetTableByXmlId("JdgMchFinalChekResultD.getInfo", resultNo);
  61. GridHelper.CopyDataToDatatable(dt, dataTable2, true);
  62. GridHelper.RefreshAndAutoSize(ultraGrid2);
  63. }
  64. private void UltraGrid2_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  65. {
  66. if (e.Row.GetValue("replayStation") == "2")
  67. {
  68. Color yellow = Color.FromArgb(255, 246, 143);
  69. e.Row.Appearance.BackColor = yellow;
  70. }
  71. }
  72. }
  73. }