QcmGpJudgeApplyCtrl.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Judge.Commons;
  5. using Core.StlMes.Client.Judge.Forms;
  6. using CoreFS.CA06;
  7. using Infragistics.Win.UltraWinGrid;
  8. using System;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Windows.Forms;
  12. namespace Core.StlMes.Client.Judge.Controls
  13. {
  14. public partial class QcmGpJudgeApplyCtrl : UserControl
  15. {
  16. private Dal _d;
  17. private OpeBase _ob;
  18. public QcmGpJudgeApplyCtrl(Control container, OpeBase ob, JudgeType judgeType)
  19. {
  20. InitializeComponent();
  21. _d = new Dal(ob);
  22. _ob = ob;
  23. container.Controls.Add(this);
  24. this.Dock = DockStyle.Fill;
  25. this.BringToFront();
  26. string strJudgeType = ((int)judgeType).ToString();
  27. if (!strJudgeType.EndsWith("1") && !strJudgeType.EndsWith("3"))
  28. {
  29. GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Chem_Result_Desc");
  30. }
  31. if (!strJudgeType.EndsWith("2") && !strJudgeType.EndsWith("3"))
  32. {
  33. GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Phy_Result_Desc");
  34. }
  35. if (!strJudgeType.EndsWith("3"))
  36. {
  37. GridHelper.HidenColumns(ultraGrid1.DisplayLayout.Bands[0], "Judge_Result");
  38. }
  39. this.ultraGrid1.DisplayLayout.Bands[0].Columns["stoveNo"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  40. //初始化下拉框
  41. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407402", ob, false);
  42. ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false);
  43. ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407406", ob, false);
  44. }
  45. public void Query(string applyTimeBegin, string applyTimeEnd, string proOrderNo, string stoveNo, string isJudge)
  46. {
  47. DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QueryP", applyTimeBegin, applyTimeEnd, proOrderNo, stoveNo, isJudge);
  48. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  49. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2");
  50. }
  51. public void QuerySteelMakingP(string stoveNo, string judgeStoveNo, string applyTimeBegin, string applyTimeEnd,
  52. string proOrderNo, string isJudge, string[] plines, string gpSource, string[] plinesGp, string customInfo)
  53. {
  54. DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QuerySteelMakingP", applyTimeBegin, applyTimeEnd, proOrderNo, stoveNo,
  55. judgeStoveNo, plines.Length, plines, isJudge, gpSource, plinesGp.Length, plinesGp, customInfo);
  56. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  57. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2");
  58. }
  59. public void QuerySteelMakingP(string stoveNo,string customInfo)
  60. {
  61. DataTable dt = _d.GetTableByXmlId("QcmGpJugdeApplyDAL.QuerySteelMakingP", "", "", "", stoveNo,
  62. "", "0", new string[0], "", "", "0", "", customInfo);
  63. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  64. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "judgeMemo", "judgeMemo2");
  65. }
  66. public void ClearData()
  67. {
  68. dataTable1.Clear();
  69. }
  70. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  71. {
  72. e.Cell.Row.Update();
  73. }
  74. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  75. {
  76. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  77. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  78. {
  79. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  80. ultraGrid1.ActiveRow.Update();
  81. }
  82. }
  83. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  84. {
  85. Color yellow = Color.FromArgb(238, 238, 0);
  86. Color red = Color.FromArgb(255, 106, 106);
  87. Color green = Color.FromArgb(60, 179, 113);
  88. if (e.Row.GetValue("judgeResultCode").Equals("40740701") || e.Row.GetValue("judgeResultCode").Equals("40740702")
  89. || e.Row.GetValue("judgeResultCode").Equals("40740706"))
  90. {
  91. //e.Row.Appearance.BackColor = green;
  92. }
  93. else if (e.Row.GetValue("judgeResultCode").Equals("40740704") || e.Row.GetValue("judgeResultCode").Equals("40740705"))
  94. {
  95. e.Row.RowSelectorAppearance.BackColor = red;
  96. }
  97. }
  98. private void ultraGrid1_MouseUp(object sender, MouseEventArgs e)
  99. {
  100. foreach (UltraGridRow row in ultraGrid1.Rows)
  101. {
  102. if (row.Selected)
  103. {
  104. row.Cells["CHK"].Value = true;
  105. }
  106. }
  107. ultraGrid1.UpdateData();
  108. }
  109. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  110. {
  111. try
  112. {
  113. this.Cursor = Cursors.WaitCursor;
  114. var row = ultraGrid1.ActiveRow;
  115. if (row == null)
  116. {
  117. MessageUtil.ShowWarning("请选择一行记录!");
  118. return;
  119. }
  120. string judgeApplyCode = row.Cells["jugdeApplyCode"].Value.ToString();
  121. string judgeApplySeq = row.Cells["jugdeApplySqe"].Value.ToString();
  122. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  123. DataRow drPassApply = _d.GetRowByXmlId("QcmGpPassApplyDAL.queryByGpJudgeApplyPk", judgeApplyCode, judgeApplySeq, judgeStoveNo);
  124. if (drPassApply == null || drPassApply["type"].ToString() == "1" ||
  125. drPassApply["type"].ToString() == "0" && drPassApply["auditResult2"].ToString() == "")
  126. {
  127. MessageUtil.ShowWarning("没有不合格品评审单可查看!");
  128. return;
  129. }
  130. else
  131. {
  132. if (drPassApply["type"].ToString() == "1")
  133. {
  134. MessageUtil.ShowWarning("紧急放行!");
  135. return;
  136. }
  137. }
  138. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPdRejectDisposalList.cpt" + "&JUDGE_STOVE_NO=" + judgeStoveNo;
  139. FrmOrderRepExcel fBug = new FrmOrderRepExcel(_ob, strurl);
  140. fBug.AutoSize = true;
  141. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  142. fBug.WindowState = FormWindowState.Maximized;
  143. fBug.Text = "不合格品评审处置单";
  144. fBug.Show();
  145. }
  146. finally
  147. {
  148. this.Cursor = Cursors.Default;
  149. }
  150. }
  151. }
  152. }