20d5f696afc74933fe2e81d74750819249fcdf4a.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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 UIB030140 : FrmBase
  15. {
  16. public UIB030140()
  17. {
  18. InitializeComponent();
  19. }
  20. private void UIB030140_Load(object sender, EventArgs e)
  21. {
  22. this.comboBox1.SelectedIndex = 0;
  23. this.DoQuery();
  24. }
  25. public override void ToolBar_Click(object sender, string ToolbarKey)
  26. {
  27. switch (ToolbarKey)
  28. {
  29. case "Query":
  30. this.DoQuery();
  31. break;
  32. case "Save":
  33. this.DoSave();
  34. break;
  35. }
  36. }
  37. private void DoQuery()
  38. {
  39. ArrayList al = new ArrayList();
  40. //冷轧判定
  41. if (this.comboBox1.Text == "连退")
  42. {
  43. al.Add("UIB030140_01.SELECT");
  44. }
  45. else
  46. {
  47. al.Add("UIB030140_02.SELECT");
  48. }
  49. this.dataSet1.Tables[0].Clear();
  50. CoreClientParam ccp = new CoreClientParam();
  51. ccp.ServerName = "UIB.COM.ComDBQuery";
  52. ccp.MethodName = "doSimpleQuery";
  53. ccp.ServerParams = new object[] { al };
  54. ccp.SourceDataTable = this.dataSet1.Tables[0];
  55. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  56. }
  57. private void DoSave()
  58. {
  59. if (MessageBox.Show("确定判定?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  60. return;
  61. try
  62. {
  63. ArrayList list = new ArrayList();
  64. ArrayList al = null;
  65. if (this.comboBox1.Text == "连退")
  66. {
  67. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  68. {
  69. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges)
  70. {
  71. al = new ArrayList();
  72. al.Add("UIB030140_01.UPDATE");
  73. al.Add(ugr.Cells["SMP_NO"].Value.ToString());
  74. al.Add(ugr.Cells["SMP_CUT_LOC"].Value.ToString());
  75. list.Add(al);
  76. }
  77. }
  78. //判定标记
  79. CoreClientParam ccp = new CoreClientParam();
  80. ccp.ServerName = "UIB.COM.ComDBSave";
  81. ccp.MethodName = "doXmlSave";
  82. ccp.ServerParams = new object[] { list };
  83. ccp.SourceDataTable = this.dataSet1.Tables[0];
  84. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  85. //材质判定
  86. ccp = new CoreClientParam();
  87. Hashtable ht = new Hashtable();
  88. ht.Add("i1", this.UserInfo.GetUserName());
  89. ht.Add("o2", "");
  90. ccp.ServerName = "UIB.COM.ComDBProcedure";
  91. ccp.MethodName = "doXmlProcedure";
  92. ccp.ServerParams = new object[] { "UIB030140_01.CALL", ht };
  93. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  94. this.DoQuery();
  95. }
  96. else
  97. {
  98. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  99. {
  100. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))//注意,这里ugr.Cells["CHK"].Text,而不能够使ugr.Cells["CHK"].Value,因为grid还没有接受改变(AcceptChanges)
  101. {
  102. al = new ArrayList();
  103. al.Add("UIB030140_01.UPDATE");
  104. al.Add(ugr.Cells["SMP_NO"].Value.ToString());
  105. al.Add(ugr.Cells["SMP_CUT_LOC"].Value.ToString());
  106. list.Add(al);
  107. }
  108. }
  109. //判定标记
  110. CoreClientParam ccp = new CoreClientParam();
  111. ccp.ServerName = "UIB.COM.ComDBSave";
  112. ccp.MethodName = "doXmlSave";
  113. ccp.ServerParams = new object[] { list };
  114. ccp.SourceDataTable = this.dataSet1.Tables[0];
  115. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  116. //材质判定
  117. ccp = new CoreClientParam();
  118. Hashtable ht = new Hashtable();
  119. ht.Add("i1", this.UserInfo.GetUserName());
  120. ht.Add("o2", "");
  121. ccp.ServerName = "UIB.COM.ComDBProcedure";
  122. ccp.MethodName = "doXmlProcedure";
  123. ccp.ServerParams = new object[] { "UIB030140_02.CALL", ht };
  124. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  125. this.DoQuery();
  126. }
  127. }
  128. catch (Exception ex)
  129. {
  130. }
  131. }
  132. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  133. {
  134. try
  135. {
  136. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  137. {
  138. ugr.Cells["CHK"].Value = this.checkBox1.Checked;
  139. //ugr.Update();
  140. }
  141. this.ultraGrid1.UpdateData();
  142. }
  143. catch (Exception ex)
  144. {
  145. System.Diagnostics.Debug.WriteLine(ex.ToString());
  146. }
  147. }
  148. }
  149. }