QcmBcPhyJudgeCtrl.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.StlMes.Client.Judge.Commons;
  3. using Core.StlMes.Client.Judge.Forms;
  4. using CoreFS.CA06;
  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 QcmBcPhyJudgeCtrl : UserControl
  12. {
  13. private Dal _d;
  14. public QcmBcPhyJudgeCtrl(Control container, OpeBase ob)
  15. {
  16. InitializeComponent();
  17. container.Controls.Add(this);
  18. this.Dock = DockStyle.Fill;
  19. _d = new Dal(ob);
  20. }
  21. public void Query(string judgeStoveNo, string batchNo, string judgeResult, string timeBegin, string timeEnd,
  22. string[] plineCodes, string process)
  23. {
  24. DataTable dt = _d.GetTableByXmlId("JdgQcmZcCheckconsign.getPhyChemJudgeInfo", judgeStoveNo, batchNo, judgeResult,
  25. timeBegin, timeEnd, plineCodes.Length, plineCodes, process);
  26. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  27. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "chemMemo", "phyMemo");
  28. foreach (var row in ultraGrid1.Rows)
  29. {
  30. if (row.GetValue("chemMemo") != "")
  31. {
  32. row.Cells["chemMemo"].EditorComponent = ultraTextEditor1;
  33. }
  34. if (row.GetValue("phyMemo") != "")
  35. {
  36. row.Cells["phyMemo"].EditorComponent = ultraTextEditor1;
  37. }
  38. }
  39. }
  40. public void Clear()
  41. {
  42. dataTable1.Clear();
  43. }
  44. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  45. {
  46. PopupTextBox popup = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 5000);
  47. popup.TxtInfo.ReadOnly = true;
  48. popup.UltraPanel1.Visible = false;
  49. popup.ShowDialog();
  50. }
  51. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  52. {
  53. Color red = Color.FromArgb(255, 106, 106);
  54. if (e.Row.GetValue("chemResultCode") == "40740102")
  55. {
  56. e.Row.Cells["chemResult"].Appearance.BackColor = red;
  57. }
  58. if (e.Row.GetValue("phyResultCode") == "40740202")
  59. {
  60. e.Row.Cells["phyResult"].Appearance.BackColor = red;
  61. }
  62. if (e.Row.GetValue("judgeResultCode") == "40740704")
  63. {
  64. e.Row.Cells["judgeResult"].Appearance.BackColor = red;
  65. }
  66. }
  67. }
  68. }