SteelMakingColligateQueryCtrl.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Tool;
  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 SteelMakingColligateQueryCtrl : UserControl
  13. {
  14. private Dal _d;
  15. public Dal D
  16. {
  17. get { return _d; }
  18. set { _d = value; }
  19. }
  20. public SteelMakingColligateQueryCtrl(Control container, OpeBase ob)
  21. {
  22. InitializeComponent();
  23. _d = new Dal(ob);
  24. container.Controls.Add(this);
  25. this.Dock = DockStyle.Fill;
  26. this.BringToFront();
  27. this.steelMakingColligateQueryGrid.DisplayLayout.Bands[0].Columns["stoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  28. }
  29. public void Query(string judgeStoveNo, string judgeState, string[] plines, string timeB, string timeE,
  30. string chemType, string gpSource, string[] plinesGp, string balYearMonthh, string proTimeB, string proTimeE,String orderNo)
  31. {
  32. DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.querySteelmakingColligateQuery",
  33. judgeStoveNo, judgeState, plines.Length, plines, timeB, timeE, chemType, gpSource,
  34. plinesGp.Length, plinesGp, balYearMonthh, proTimeB, proTimeE, orderNo);
  35. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  36. Color green = Color.FromArgb(60, 179, 113);
  37. foreach (var row in steelMakingColligateQueryGrid.Rows)
  38. {
  39. if (row.GetValue("cutNum").TryParseInt() && int.Parse(row.GetValue("cutNum")) > 1)
  40. {
  41. row.Cells["judgeStoveNo"].Appearance.BackColor = green;
  42. }
  43. }
  44. GridHelper.RefreshAndAutoSize(steelMakingColligateQueryGrid);
  45. }
  46. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  47. {
  48. Color red = Color.FromArgb(255, 106, 106);
  49. Color gray = Color.FromArgb(205, 201, 201);
  50. if (e.Row.GetValue("chemResultCode") == "40740102" || e.Row.GetValue("chemResultCode") == "40740104")
  51. {
  52. e.Row.RowSelectorAppearance.BackColor = red;
  53. }
  54. if (e.Row.GetValue("phyResultCode") == "40740204" || e.Row.GetValue("phyResultCode") == "40740205")
  55. {
  56. e.Row.RowSelectorAppearance.BackColor = red;
  57. }
  58. if (e.Row.GetValue("isFlag") == "1")
  59. {
  60. e.Row.Appearance.BackColor = gray;
  61. }
  62. }
  63. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  64. {
  65. try
  66. {
  67. this.Cursor = Cursors.WaitCursor;
  68. var row = steelMakingColligateQueryGrid.ActiveRow;
  69. if (row == null)
  70. {
  71. MessageUtil.ShowWarning("请选择一行记录!");
  72. return;
  73. }
  74. string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString();
  75. string judgeApplySeq = row.Cells["jugdeApplySqe"].Value.ToString();
  76. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  77. DataRow drPassApply = _d.GetRowByXmlId("QcmGpPassApplyDAL.queryByGpJudgeApplyPk", judgeApplyCode, judgeApplySeq, judgeStoveNo);
  78. if (drPassApply == null || drPassApply["type"].ToString() == "1" ||
  79. drPassApply["type"].ToString() == "0" && drPassApply["auditResult2"].ToString() == "")
  80. {
  81. MessageUtil.ShowWarning("没有不合格品评审单可查看!");
  82. return;
  83. }
  84. else
  85. {
  86. if (drPassApply["type"].ToString() == "1")
  87. {
  88. MessageUtil.ShowWarning("紧急放行!");
  89. return;
  90. }
  91. }
  92. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPdRejectDisposalList.cpt" + "&JUDGE_STOVE_NO=" + judgeStoveNo;
  93. FrmOrderRepExcel fBug = new FrmOrderRepExcel(_d.Ob, strurl);
  94. fBug.AutoSize = true;
  95. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  96. fBug.WindowState = FormWindowState.Maximized;
  97. fBug.Text = "不合格品评审处置单";
  98. fBug.Show();
  99. }
  100. finally
  101. {
  102. this.Cursor = Cursors.Default;
  103. }
  104. }
  105. }
  106. }