299f87dd2af5c23869b5a7f73cb99e69a6493a33.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 UIB030210 : FrmBase
  15. {
  16. public UIB030210()
  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.comboBox1.Text == "酸轧")
  38. {
  39. al.Add("UIB030210_01.SELECT");
  40. }
  41. else if (this.comboBox1.Text == "连退")
  42. {
  43. al.Add("UIB030210_02.SELECT");
  44. }
  45. else if (this.comboBox1.Text == "酸洗")
  46. {
  47. al.Add("UIB030210_03.SELECT");
  48. }
  49. if (al.Count == 0) return;
  50. this.dataSet1.Tables[0].Clear();
  51. CoreClientParam ccp = new CoreClientParam();
  52. ccp.ServerName = "UIB.COM.ComDBQuery";
  53. ccp.MethodName = "doSimpleQuery";
  54. ccp.ServerParams = new object[] { al };
  55. ccp.SourceDataTable = this.dataSet1.Tables[0];
  56. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  57. }
  58. catch (Exception ex)
  59. {
  60. }
  61. }
  62. public void DoSave()
  63. {
  64. if ((this.comboBox1.Text == "酸轧")||(this.comboBox1.Text == "酸洗"))
  65. {
  66. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  67. {
  68. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges)
  69. {
  70. CoreClientParam ccp = new CoreClientParam();
  71. Hashtable ht = new Hashtable();
  72. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  73. ht.Add("i2", this.UserInfo.GetUserName());
  74. ht.Add("o3", "");
  75. ccp.ServerName = "UIB.COM.ComDBProcedure";
  76. ccp.MethodName = "doXmlProcedure";
  77. ccp.ServerParams = new object[] { "UIB030210_01.CALL", ht };
  78. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  79. }
  80. }
  81. }
  82. else if (this.comboBox1.Text == "连退")
  83. {
  84. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  85. {
  86. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges)
  87. {
  88. CoreClientParam ccp = new CoreClientParam();
  89. Hashtable ht = new Hashtable();
  90. ht.Add("i1", ugr.Cells["COIL_NO"].Text);
  91. ht.Add("i2", this.UserInfo.GetUserName());
  92. ht.Add("o3", "");
  93. ccp.ServerName = "UIB.COM.ComDBProcedure";
  94. ccp.MethodName = "doXmlProcedure";
  95. ccp.ServerParams = new object[] { "UIB030210_02.CALL", ht };
  96. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  97. }
  98. }
  99. }
  100. this.DoQuery();
  101. }
  102. private void UIB030210_Load(object sender, EventArgs e)
  103. {
  104. this.comboBox1.SelectedIndex = 1;
  105. this.DoQuery();
  106. }
  107. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  108. {
  109. try
  110. {
  111. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  112. {
  113. ugr.Cells["CHK"].Value = this.checkBox1.Checked;
  114. ugr.Update();
  115. }
  116. }
  117. catch (Exception ex)
  118. {
  119. System.Diagnostics.Debug.WriteLine(ex.ToString());
  120. }
  121. }
  122. private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
  123. {
  124. this.DoQuery();
  125. }
  126. }
  127. }