UIB030160.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 UIB030160 : FrmBase
  15. {
  16. private string pickCoilNo = "";//取样卷
  17. public UIB030160()
  18. {
  19. InitializeComponent();
  20. }
  21. public override void ToolBar_Click(object sender, string ToolbarKey)
  22. {
  23. switch (ToolbarKey)
  24. {
  25. case "Query":
  26. this.DoQuery();
  27. break;
  28. case "Save":
  29. this.DoSave();
  30. break;
  31. }
  32. }
  33. public void DoQuery()
  34. {
  35. try
  36. {
  37. ArrayList al = new ArrayList();
  38. if (this.comboBox3.Text == "酸洗")
  39. {
  40. al.Add("UIB030160_02.SELECT");
  41. }
  42. else
  43. {
  44. al.Add("UIB030160_01.SELECT");
  45. }
  46. al.Add(this.textBox1.Text.Trim());
  47. this.dataSet1.Tables[0].Clear();
  48. CoreClientParam ccp = new CoreClientParam();
  49. ccp.ServerName = "UIB.COM.ComDBQuery";
  50. ccp.MethodName = "doSimpleQuery";
  51. ccp.ServerParams = new object[] { al };
  52. ccp.SourceDataTable = this.dataSet1.Tables[0];
  53. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  54. }
  55. catch (Exception ex)
  56. {
  57. }
  58. }
  59. public void DoSave()
  60. {
  61. try
  62. {
  63. // if (this.comboBox1.Text != "N") return;
  64. if (MessageBox.Show("确定不进行进行复样?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  65. return;
  66. ArrayList list = new ArrayList();
  67. ArrayList al = null;
  68. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  69. {
  70. // if (ugr.Selected == true)
  71. if(ugr.Cells["CHK"].Text == "True")
  72. {
  73. al = new ArrayList();
  74. al.Add("UIB030160_01.UPDATE");
  75. al.Add(ugr.Cells["SMP_NO"].Text);
  76. al.Add(ugr.Cells["SMP_CUT_LOC"].Text);
  77. list.Add(al);
  78. }
  79. }
  80. if (list.Count == 0) return;
  81. CoreClientParam ccp = new CoreClientParam();
  82. ccp.ServerName = "UIB.COM.ComDBSave";
  83. ccp.MethodName = "doXmlSave";
  84. ccp.ServerParams = new object[] { list };
  85. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  86. this.DoQuery();
  87. }
  88. catch (Exception ex)
  89. {
  90. }
  91. }
  92. private void ultraGrid1_MouseDown(object sender, MouseEventArgs e)
  93. {
  94. try
  95. {
  96. if (this.ultraGrid1.ActiveRow == null) return;
  97. if (this.ultraGrid1.ActiveCell.Column.Key != "COIL_NO") return;
  98. if (MessageBox.Show("确定以该卷作为取样卷进行复样?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  99. return;
  100. pickCoilNo = this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text;
  101. CoreClientParam ccp = new CoreClientParam();
  102. Hashtable ht = new Hashtable();
  103. ht.Add("i1", pickCoilNo);//取样卷
  104. ht.Add("i2", "");
  105. ht.Add("o3", "");
  106. ccp.ServerName = "UIB.COM.ComDBProcedure";
  107. ccp.MethodName = "doXmlProcedure";
  108. if (this.comboBox3.Text == "酸洗")
  109. {
  110. ccp.ServerParams = new object[] { "UIB030160_02.CALL", ht };
  111. }
  112. else
  113. {
  114. ccp.ServerParams = new object[] { "UIB030160_01.CALL", ht };
  115. }
  116. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  117. this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点
  118. }
  119. catch (Exception ex)
  120. {
  121. }
  122. this.DoQuery();
  123. }
  124. private void UIB030160_Load(object sender, EventArgs e)
  125. {
  126. this.comboBox3.SelectedIndex = 0;
  127. }
  128. }
  129. }