fece5c2a42c5e0cca2d5ac6899761b7c9179abb6.svn-base 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. namespace Core.LZMes.Client.UIB
  12. {
  13. public partial class UIB030120 : FrmBase
  14. {
  15. private string ComServerClassName = "UIB.COM.ComDBQuery";
  16. public UIB030120()
  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. this.dataSet1.Tables[0].Clear();
  37. CoreClientParam ccp = new CoreClientParam();
  38. ArrayList al = new ArrayList();
  39. if (this.comboBox3.Text == "")
  40. {
  41. MessageBox.Show("请选择产线!", "提示");
  42. return;
  43. }
  44. if (this.comboBox3.Text == "酸洗")
  45. {
  46. if (this.ultraComboEditor1.Value.ToString() == "")//无条件查询
  47. {
  48. al.Add("UIB030120_04.SELECT");
  49. }
  50. else//试样检验待机或试样判定待机
  51. {
  52. al.Add("UIB030120_05.SELECT");
  53. al.Add(this.ultraComboEditor1.Value.ToString());
  54. }
  55. }
  56. else
  57. {
  58. if (this.ultraComboEditor1.Value.ToString() == "")//无条件查询
  59. {
  60. al.Add("UIB030120_01.SELECT");
  61. }
  62. else//试样检验待机或试样判定待机
  63. {
  64. al.Add("UIB030120_02.SELECT");
  65. al.Add(this.ultraComboEditor1.Value.ToString());
  66. }
  67. }
  68. ccp.ServerName = ComServerClassName;
  69. ccp.MethodName = "doSimpleQuery";
  70. ccp.ServerParams = new object[] {al};
  71. ccp.SourceDataTable = this.dataSet1.Tables[0];
  72. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  73. }
  74. catch(Exception ex)
  75. {
  76. MessageBox.Show(ex.ToString());
  77. }
  78. }
  79. public void DoSave()
  80. {
  81. }
  82. private void UIB020330_Load(object sender, EventArgs e)
  83. {
  84. this.ultraComboEditor1.SelectedIndex = 0;
  85. this.comboBox3.SelectedIndex = 0;
  86. }
  87. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  88. {
  89. // if(e.Cell.Column.Key=)
  90. }
  91. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  92. {
  93. if (this.ultraGrid1.ActiveRow == null) return;
  94. //if (this.ultraGrid1.ActiveRow.Selected == false) return;
  95. this.dataSet2.Tables[0].Clear();
  96. CoreClientParam ccp = new CoreClientParam();
  97. ArrayList al = new ArrayList();
  98. al.Add("UIB030120_03.SELECT");
  99. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Value.ToString());
  100. al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Value.ToString());
  101. ccp.ServerName = ComServerClassName;
  102. ccp.MethodName = "doSimpleQuery";
  103. ccp.ServerParams = new object[] { al};
  104. ccp.SourceDataTable = this.dataSet2.Tables[0];
  105. this.ExecuteQueryToDataTable(ccp , CoreInvokeType.Internal);
  106. }
  107. private void ultraGrid2_KeyDown(object sender, KeyEventArgs e)
  108. {
  109. try
  110. {
  111. if (e.KeyCode != Keys.Enter) return;//回车时,才保存数据
  112. if (this.ultraGrid2.ActiveCell == null) return;
  113. if (this.ultraGrid2.ActiveCell.DataChanged == true)//数据有修改时才执行update操作
  114. {
  115. Hashtable ht = new Hashtable();
  116. ht.Add("i1", this.ultraGrid2.ActiveRow.Cells["SMP_NO"].Text);
  117. ht.Add("i2", this.ultraGrid2.ActiveRow.Cells["SMP_CUT_LOC"].Text);
  118. ht.Add("i3", this.ultraGrid2.ActiveRow.Cells["QLTY_CD"].Text);
  119. ht.Add("i4", this.ultraGrid2.ActiveRow.Cells["QLTY_SEQ"].Text);
  120. ht.Add("i5", this.ultraGrid2.ActiveRow.Cells["QLTY_VAL_WK"].Text);
  121. ht.Add("i6", this.UserInfo.GetUserID());
  122. ht.Add("o7", "");
  123. CoreClientParam ccp = new CoreClientParam();
  124. ccp.ServerName = "UIB.COM.ComDBProcedure";
  125. ccp.MethodName = "doXmlProcedure";
  126. ccp.ServerParams = new object[] { "UIB030120_01.CALL", ht };
  127. this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  128. }
  129. //换行,并编辑
  130. this.ultraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
  131. this.ultraGrid2.ActiveRow.Cells["QLTY_VAL_WK"].Activate();
  132. this.ultraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
  133. }
  134. catch (Exception ex)
  135. {
  136. System.Diagnostics.Debug.WriteLine(ex.ToString());
  137. }
  138. }
  139. private void button1_Click(object sender, EventArgs e)
  140. {
  141. DoSave();
  142. }
  143. }
  144. }