UIE041010.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. namespace Core.LZMes.Client.UIE
  11. {
  12. public partial class UIE041010 : FrmBase
  13. {
  14. public UIE041010()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void ToolBar_Click(object sender, string ToolbarKey)
  19. {
  20. switch (ToolbarKey)
  21. {
  22. case "Query":
  23. this.DoQuery();
  24. break;
  25. case "Save":
  26. this.DoUpdate();
  27. break;
  28. }
  29. }
  30. private void DoQuery()
  31. {
  32. try
  33. {
  34. string areaType = "1";
  35. this.dataSet1.Tables[0].Clear();
  36. CoreClientParam ccp = new CoreClientParam();
  37. ccp.InvokeID = "C06010103";
  38. ccp.ServerName = "UIE.UIE01.UIE041010";
  39. ccp.MethodName = "query01";
  40. ccp.ServerParams = new object[] { areaType };
  41. ccp.SourceDataTable = this.dataSet1.Tables[0];
  42. this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
  43. Console.WriteLine(this.dataSet1.Tables[0].ToString());
  44. }
  45. catch (Exception EX)
  46. {
  47. MessageBox.Show(EX.ToString());
  48. }
  49. }
  50. private void DoUpdate()
  51. {
  52. try
  53. {
  54. string used_yn = "";
  55. string proc_rate = this.textBox3.Text;
  56. string proc_cd = this.textBox2.Text;
  57. if (this.checkBox1.Checked) {
  58. used_yn = "Y";
  59. }else{
  60. used_yn = "N";
  61. }
  62. CoreClientParam ccp = new CoreClientParam();
  63. ccp.ServerName = "UIE.UIE01.UIE041010";
  64. ccp.MethodName = "update01";
  65. ccp.ServerParams = new object[] { proc_rate, used_yn, proc_cd };
  66. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  67. if (ccp.ReturnCode != 0) return;
  68. this.ultraGrid1.Refresh();
  69. MessageBox.Show("修改数据成功!");
  70. }
  71. catch (Exception EX)
  72. {
  73. MessageBox.Show(EX.ToString());
  74. }
  75. }
  76. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  77. {
  78. if (!this.checkBox1.Checked)
  79. {
  80. this.textBox1.Text = "";
  81. this.textBox2.Text = "";
  82. this.textBox3.Text = "";
  83. }
  84. }
  85. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  86. {
  87. string v_proc_rate = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["PROC_RATE"].Value));
  88. string v_proc_nm = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["PROC_NM"].Value));
  89. string v_proc_cd = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["PROC_CD"].Value));
  90. string v_chk = Convert.ToString(Common.FixDBManager.CheckNullStr(this.ultraGrid1.ActiveRow.Cells["USED_YN"].Value));
  91. this.textBox3.Text = v_proc_rate;
  92. this.textBox1.Text = v_proc_nm;
  93. this.textBox2.Text = v_proc_cd;
  94. if (v_chk.Equals("Y"))
  95. {
  96. this.checkBox1.Checked = true;
  97. }
  98. else
  99. {
  100. this.checkBox1.Checked = false;
  101. }
  102. }
  103. }
  104. }