05ba65e76a950fca372dc070af70a0f65e4f1ec2.svn-base 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 QCM030712 : FrmBase
  14. {
  15. public QCM030712()
  16. {
  17. InitializeComponent();
  18. }
  19. public string material_no = "";
  20. public string prod_name = "";
  21. public string prodline = "";
  22. public string grade_name = "";
  23. private void QCM030701_Load(object sender, EventArgs e)
  24. {
  25. try
  26. {
  27. this.dataSet4.Clear();
  28. CoreClientParam ccp = new CoreClientParam();
  29. ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl";
  30. ccp.MethodName = "GetSteelChemInfo";
  31. ccp.ServerParams = new object[] { material_no,prod_name,prodline,grade_name };
  32. ccp.SourceDataTable = this.dataSet4.Tables[0];
  33. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  34. if(this.ultraGrid5.DisplayLayout.Bands[0].Columns.Contains("CHECKBOXS"))
  35. {
  36. ultraGrid5.DisplayLayout.Bands[0].Columns["CHECKBOXS"].Hidden = true;
  37. }
  38. UltraGridRow judge_row = null;
  39. foreach (UltraGridRow ugs in this.ultraGrid5.Rows)
  40. {
  41. if (ugs.Cells["STD_TYPE"].Text.ToString().StartsWith("J"))
  42. {
  43. judge_row = ugs;
  44. }
  45. }
  46. if (judge_row != null)
  47. {
  48. foreach (UltraGridRow ugs in this.ultraGrid5.Rows)
  49. {
  50. if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)")
  51. {
  52. for (int i = 0; i < ugs.Cells.Count; i++)
  53. {
  54. if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" "))
  55. {
  56. string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#');
  57. if (str_arr.Length == 1)
  58. {
  59. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  60. {
  61. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  62. {
  63. ugs.Cells[i].Appearance.BackColor = Color.Red;
  64. }
  65. }
  66. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  67. {
  68. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  69. {
  70. ugs.Cells[i].Appearance.BackColor = Color.Red;
  71. }
  72. }
  73. }
  74. else if (str_arr.Length == 2)
  75. {
  76. if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  77. {
  78. if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  79. {
  80. ugs.Cells[i].Appearance.BackColor = Color.Red;
  81. }
  82. }
  83. else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  84. {
  85. if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  86. {
  87. ugs.Cells[i].Appearance.BackColor = Color.Red;
  88. }
  89. }
  90. if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  91. {
  92. if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString()))
  93. {
  94. ugs.Cells[i].Appearance.BackColor = Color.Red;
  95. }
  96. }
  97. else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text))
  98. {
  99. if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString()))
  100. {
  101. ugs.Cells[i].Appearance.BackColor = Color.Red;
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. catch (Exception ex)
  112. {
  113. System.Diagnostics.Debug.WriteLine(ex.ToString());
  114. MessageBox.Show("系统出错,请联系管理人员", "警告");
  115. }
  116. }
  117. }
  118. }