UIB030150.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 System.Collections;
  11. using Infragistics.Win.UltraWinGrid;
  12. namespace Core.LZMes.Client.UIB
  13. {
  14. public partial class UIB030150 : FrmBase
  15. {
  16. public UIB030150()
  17. {
  18. InitializeComponent();
  19. }
  20. public override void ToolBar_Click(object sender, string ToolbarKey)
  21. {
  22. switch (ToolbarKey)
  23. {
  24. case "Query":
  25. this.DoQuery();
  26. break;
  27. case "Save":
  28. this.DoSave();
  29. break;
  30. }
  31. }
  32. public void DoQuery()
  33. {
  34. try
  35. {
  36. ArrayList al = new ArrayList();
  37. if (this.comboBox3.Text == "酸洗")
  38. {
  39. al.Add("UIB030150_03.SELECT");
  40. }
  41. else
  42. {
  43. al.Add("UIB030150_01.SELECT");
  44. }
  45. al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd")+"000000");
  46. al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd")+"999999");
  47. al.Add(this.textBox3_COILNO.Text.Trim());
  48. this.dataSet1.Tables[0].Clear();
  49. CoreClientParam ccp = new CoreClientParam();
  50. ccp.ServerName = "UIB.COM.ComDBQuery";
  51. ccp.MethodName = "doSimpleQuery";
  52. ccp.ServerParams = new object[] { al };
  53. ccp.SourceDataTable = this.dataSet1.Tables[0];
  54. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  55. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  56. {
  57. if (ugr.Cells["MATLQLTY_DEC_GRD"].Text == "2")
  58. ugr.RowSelectorAppearance.BackColor = Color.Red;
  59. }
  60. }
  61. catch (Exception ex)
  62. {
  63. }
  64. }
  65. public void DoSave()
  66. {
  67. try
  68. {
  69. if (MessageBox.Show("确认取消判定?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  70. return;
  71. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  72. {
  73. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  74. {
  75. CoreClientParam ccp = new CoreClientParam();
  76. Hashtable ht = new Hashtable();
  77. ht.Add("i1", ugr.Cells["SMP_NO"].Text);
  78. ht.Add("i2", ugr.Cells["SMP_CUT_LOC"].Text);
  79. ht.Add("i3", this.UserInfo.GetUserName());
  80. ht.Add("o4", "");
  81. ccp.ServerName = "UIB.COM.ComDBProcedure";
  82. ccp.MethodName = "doXmlProcedure";
  83. if (this.comboBox3.Text == "酸洗")
  84. {
  85. ccp.ServerParams = new object[] { "UIB030150_02.CALL", ht };
  86. }
  87. else
  88. {
  89. ccp.ServerParams = new object[] { "UIB030150_01.CALL", ht };
  90. }
  91. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  92. }
  93. }
  94. this.DoQuery();
  95. }
  96. catch (Exception ex)
  97. {
  98. }
  99. }
  100. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  101. {
  102. try
  103. {
  104. if (this.ultraGrid1.ActiveRow == null) return;
  105. //if(this.ultraGrid1.ActiveRow.Cells[]);
  106. //if (this.ultraGrid1.ActiveCell.Column.Key == "CHK")
  107. // return;
  108. ArrayList al = new ArrayList();
  109. if (this.comboBox3.Text == "酸洗")
  110. {
  111. al.Add("UIB030150_04.SELECT");
  112. }
  113. else
  114. {
  115. al.Add("UIB030150_02.SELECT");
  116. }
  117. al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text);
  118. al.Add(this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text);
  119. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text);
  120. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  121. this.dataSet2.Tables[0].Clear();
  122. CoreClientParam ccp = new CoreClientParam();
  123. ccp.ServerName = "UIB.COM.ComDBQuery";
  124. ccp.MethodName = "doSimpleQuery";
  125. ccp.ServerParams = new object[] { al };
  126. ccp.SourceDataTable = this.dataSet2.Tables[0];
  127. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  128. foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
  129. {
  130. if (ugr.Cells["QLTY_DCS_RST"].Text == "2")
  131. ugr.RowSelectorAppearance.BackColor = Color.Red;
  132. }
  133. }
  134. catch (Exception ex)
  135. {
  136. }
  137. }
  138. private void UIB030150_Load(object sender, EventArgs e)
  139. {
  140. this.comboBox3.SelectedIndex = 0;
  141. }
  142. }
  143. }