UIB100102.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 UIB100102 : FrmBase
  15. {
  16. public UIB100102()
  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. case "Delete":
  31. this.DoDelete();
  32. break;
  33. }
  34. }
  35. public void DoQuery()
  36. {
  37. try
  38. {
  39. this.dataSet1.Tables[0].Clear();
  40. ArrayList al = new ArrayList();
  41. al.Add("UIB100102_01.SELECT");
  42. al.Add(this.textBox1.Text.Trim());
  43. CoreClientParam ccp = new CoreClientParam();
  44. ccp.ServerName = "UIB.JHY.JHYComQuery";
  45. ccp.MethodName = "doSimpleQuery";
  46. ccp.ServerParams = new object[] { al };
  47. ccp.SourceDataTable = this.dataSet1.Tables[0];
  48. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  49. }
  50. catch (Exception ex)
  51. {
  52. }
  53. }
  54. public void DoSave()
  55. {
  56. try
  57. {
  58. //if (this.UserInfo.GetUserID() != "1"
  59. // && this.UserInfo.GetUserID() != "zw"
  60. // && this.UserInfo.GetUserID() != "lyb"
  61. // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; }
  62. if (MessageBox.Show("确定保存?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  63. return;
  64. ArrayList list = null;
  65. ArrayList al = new ArrayList();
  66. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  67. {
  68. if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
  69. {
  70. list = new ArrayList();
  71. if(ugr.Cells["QLTY_CD_XP"].Text != "")//若存在编码,则说明是更新
  72. {
  73. list.Add("UIB100102_01.UPDATE");
  74. list.Add(ugr.Cells["QLTY_CD_1"].Text);
  75. list.Add(ugr.Cells["QLTY_CD_2"].Text);
  76. list.Add(ugr.Cells["QLTY_CD_2_NM"].Text);
  77. list.Add(ugr.Cells["QLTY_CD_3"].Text);
  78. list.Add(ugr.Cells["QLTY_CD_3_NM"].Text);
  79. list.Add(ugr.Cells["QLTY_CD"].Text);
  80. list.Add(ugr.Cells["QLTY_CD_CFNM"].Text);
  81. list.Add(ugr.Cells["QLTY_UNIT"].Text);
  82. list.Add(ugr.Cells["QLTY_TYPE"].Text);
  83. list.Add(ugr.Cells["DISPLAY_SEQ"].Text);
  84. list.Add(ugr.Cells["QLTY_OPE_CD"].Text);
  85. list.Add(ugr.Cells["QLTY_DIR"].Text);
  86. list.Add(ugr.Cells["QLTY_SIZ"].Text);
  87. list.Add(ugr.Cells["QLTY_TEM"].Text);
  88. list.Add(ugr.Cells["QLTY_RP"].Text);
  89. list.Add(ugr.Cells["QLTY_CD_XP"].Text);
  90. }
  91. else//插入
  92. {
  93. list.Add("UIB100102_01.INSERT");
  94. list.Add(ugr.Cells["QLTY_CD_1"].Text);
  95. list.Add(ugr.Cells["QLTY_CD_2"].Text);
  96. list.Add(ugr.Cells["QLTY_CD_2_NM"].Text);
  97. list.Add(ugr.Cells["QLTY_CD_3"].Text);
  98. list.Add(ugr.Cells["QLTY_CD_3_NM"].Text);
  99. list.Add(ugr.Cells["QLTY_CD"].Text);
  100. list.Add(ugr.Cells["QLTY_CD_CFNM"].Text);
  101. list.Add(ugr.Cells["QLTY_UNIT"].Text);
  102. list.Add(ugr.Cells["QLTY_TYPE"].Text);
  103. list.Add(ugr.Cells["DISPLAY_SEQ"].Text);
  104. list.Add(ugr.Cells["QLTY_OPE_CD"].Text);
  105. list.Add(ugr.Cells["QLTY_DIR"].Text);
  106. list.Add(ugr.Cells["QLTY_SIZ"].Text);
  107. list.Add(ugr.Cells["QLTY_TEM"].Text);
  108. list.Add(ugr.Cells["QLTY_RP"].Text);
  109. }//更新或插入判断结束
  110. al.Add(list);
  111. }//CHK判断结束
  112. }//grid循环判断结束
  113. if (al.Count == 0) return;
  114. CoreClientParam ccp = new CoreClientParam();
  115. ccp.ServerName = "UIB.JHY.JHYComSave";
  116. ccp.MethodName = "doSimpleSave";
  117. ccp.ServerParams = new object[] { al };
  118. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  119. this.DoQuery();
  120. }
  121. catch (Exception ex)
  122. {
  123. }
  124. }
  125. public void DoDelete()
  126. {
  127. try
  128. {
  129. //if (this.UserInfo.GetUserID() != "1"
  130. // && this.UserInfo.GetUserID() != "zw"
  131. // && this.UserInfo.GetUserID() != "lyb"
  132. // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; }
  133. if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  134. return;
  135. ArrayList al = new ArrayList();
  136. foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
  137. {
  138. if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
  139. {
  140. ArrayList list = new ArrayList();
  141. list.Add("UIB100102_01.DELETE");
  142. list.Add(ugr.Cells["QLTY_CD"].Text.Trim());
  143. al.Add(list);
  144. }
  145. }
  146. if (al.Count == 0) return;
  147. CoreClientParam ccp = new CoreClientParam();
  148. ccp.ServerName = "UIB.JHY.JHYComSave";
  149. ccp.MethodName = "doSimpleSave";
  150. ccp.ServerParams = new object[] { al };
  151. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  152. this.DoQuery();
  153. }
  154. catch (Exception ex)
  155. {
  156. }
  157. }
  158. }
  159. }