QcmPhyPassApplyCtrl.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.StlMes.Client.Judge.Commons;
  3. using CoreFS.CA06;
  4. using CoreFS.SA06;
  5. using Infragistics.Win.UltraWinGrid;
  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 QcmPhyPassApplyCtrl : UserControl
  13. {
  14. private Dal _d;
  15. private OpeBase ob;
  16. private string _unitCode;
  17. public QcmPhyPassApplyCtrl(Control container, OpeBase ob, string unitCode)
  18. {
  19. InitializeComponent();
  20. _d = new Dal(ob);
  21. this.ob = ob;
  22. _unitCode = unitCode;
  23. container.Controls.Add(this);
  24. this.Dock = DockStyle.Fill;
  25. this.BringToFront();
  26. }
  27. public void AuditeQuery(string checkNo, string batchNo, string timeB, string timeE, string passType,
  28. string auditState, string validflag, string processCode)
  29. {
  30. DataTable dt;
  31. dt = _d.GetTableByXmlId("QcmBcPassApplyDAL.auditePhyQuery", checkNo, batchNo, timeB, timeE, auditState,
  32. passType, validflag, CoreUserInfo.UserInfo.GetUserName(), _unitCode, processCode);
  33. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  34. GridHelper.RefreshAndAutoSize(ultraGrid1);
  35. }
  36. public void AllQuery(string judgeStoveNo, string batchNo, string timeB, string timeE,
  37. string passType, string validflag, string processCode)
  38. {
  39. DataTable dt = _d.GetTableByXmlId("QcmBcPassApplyDAL.allQuery", judgeStoveNo,
  40. batchNo, timeB, timeE, passType, validflag, processCode);
  41. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  42. GridHelper.RefreshAndAutoSize(ultraGrid1);
  43. }
  44. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  45. {
  46. e.Cell.Row.Update();
  47. }
  48. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  49. {
  50. Color yellow = Color.FromArgb(238, 238, 0);
  51. Color red = Color.FromArgb(255, 106, 106);
  52. Color green = Color.FromArgb(60, 179, 113);
  53. if (e.Row.GetValue("validflag") == "0")
  54. {
  55. e.Row.RowSelectorAppearance.BackColor = Color.Red;
  56. }
  57. if (e.Row.GetValue("auditResult") == "审核通过")
  58. {
  59. e.Row.RowSelectorAppearance.BackColor = green;
  60. }
  61. else if (e.Row.GetValue("auditResult") == "审核通过")
  62. {
  63. e.Row.RowSelectorAppearance.BackColor = yellow;
  64. }
  65. else if (e.Row.GetValue("auditResult") == "审核不通过")
  66. {
  67. e.Row.RowSelectorAppearance.BackColor = red;
  68. }
  69. }
  70. FormFileDown askDown;
  71. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  72. {
  73. string filePath = ultraGrid1.ActiveRow.GetValue("craftPath");
  74. askDown = new FormFileDown(ob, filePath);
  75. askDown.DeleteButton.Visible = false;
  76. askDown.Show();
  77. }
  78. private void ultraGrid1_MouseUp(object sender, MouseEventArgs e)
  79. {
  80. foreach (UltraGridRow row in ultraGrid1.Rows)
  81. {
  82. if (row.Selected)
  83. {
  84. row.Cells["CHK"].Value = true;
  85. }
  86. }
  87. ultraGrid1.UpdateData();
  88. }
  89. }
  90. }