655de5d3cffc83021e3f328b06328d12a8819553.svn-base 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Infragistics.Win.UltraWinGrid;
  11. namespace Core.LZMes.Client.QCM.QCM03
  12. {
  13. public partial class QCM030718 : FrmBase
  14. {
  15. public QCM030718()
  16. {
  17. InitializeComponent();
  18. }
  19. public string design_key = "";
  20. public string heat_no = "";
  21. public string grade_name = "";
  22. private void QCM030701_Load(object sender, EventArgs e)
  23. {
  24. try
  25. {
  26. this.dataSet4.Clear();
  27. CoreClientParam ccp = new CoreClientParam();
  28. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  29. ccp.MethodName = "GetLgRChemeInfo";
  30. ccp.ServerParams = new object[] { design_key, heat_no, grade_name };
  31. ccp.SourceDataTable = this.dataSet4.Tables[0];
  32. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  33. if(this.ultraGrid5.DisplayLayout.Bands[0].Columns.Contains("CHECKBOXS"))
  34. {
  35. ultraGrid5.DisplayLayout.Bands[0].Columns["CHECKBOXS"].Hidden = true;
  36. }
  37. UltraGridRow judge_row = null;
  38. foreach (UltraGridRow ugs in this.ultraGrid5.Rows)
  39. {
  40. if (ugs.Cells["STD_TYPE"].Text.ToString().StartsWith("J"))
  41. {
  42. judge_row = ugs;
  43. }
  44. }
  45. if (judge_row != null)
  46. {
  47. foreach (UltraGridRow ugs in this.ultraGrid5.Rows)
  48. {
  49. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)")
  50. {
  51. for (int i = 0; i < ugs.Cells.Count; i++)
  52. {
  53. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  54. {
  55. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  56. if (str_arr.Length == 1)
  57. {
  58. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  59. {
  60. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  61. {
  62. ugs.Cells[i].Appearance.BackColor = Color.Red;
  63. }
  64. }
  65. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  66. {
  67. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  68. {
  69. ugs.Cells[i].Appearance.BackColor = Color.Red;
  70. }
  71. }
  72. }
  73. else if (str_arr.Length == 2)
  74. {
  75. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  76. {
  77. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  78. {
  79. ugs.Cells[i].Appearance.BackColor = Color.Red;
  80. }
  81. }
  82. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  83. {
  84. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  85. {
  86. ugs.Cells[i].Appearance.BackColor = Color.Red;
  87. }
  88. }
  89. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  90. {
  91. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  92. {
  93. ugs.Cells[i].Appearance.BackColor = Color.Red;
  94. }
  95. }
  96. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  97. {
  98. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  99. {
  100. ugs.Cells[i].Appearance.BackColor = Color.Red;
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. catch (Exception ex)
  111. {
  112. System.Diagnostics.Debug.WriteLine(ex.ToString());
  113. MessageBox.Show("系统出错,请联系管理人员", "警告");
  114. }
  115. }
  116. private void btnOK_Click(object sender, EventArgs e)
  117. {
  118. this.DialogResult = DialogResult.OK;
  119. this.Close();
  120. }
  121. private void btnCancel_Click(object sender, EventArgs e)
  122. {
  123. this.Close();
  124. }
  125. }
  126. }