| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.LZMes.Client.UIB
- {
- public partial class UIB100102 : FrmBase
- {
- public UIB100102()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.DoSave();
- break;
- case "Delete":
- this.DoDelete();
- break;
- }
- }
- public void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- ArrayList al = new ArrayList();
- al.Add("UIB100102_01.SELECT");
- al.Add(this.textBox1.Text.Trim());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.JHY.JHYComQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
-
- }
- catch (Exception ex)
- {
- }
- }
- public void DoSave()
- {
- try
- {
- //if (this.UserInfo.GetUserID() != "1"
- // && this.UserInfo.GetUserID() != "zw"
- // && this.UserInfo.GetUserID() != "lyb"
- // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; }
- if (MessageBox.Show("确定保存?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- ArrayList list = null;
- ArrayList al = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Value))
- {
- list = new ArrayList();
- if(ugr.Cells["QLTY_CD_XP"].Text != "")//若存在编码,则说明是更新
- {
- list.Add("UIB100102_01.UPDATE");
- list.Add(ugr.Cells["QLTY_CD_1"].Text);
- list.Add(ugr.Cells["QLTY_CD_2"].Text);
- list.Add(ugr.Cells["QLTY_CD_2_NM"].Text);
- list.Add(ugr.Cells["QLTY_CD_3"].Text);
- list.Add(ugr.Cells["QLTY_CD_3_NM"].Text);
- list.Add(ugr.Cells["QLTY_CD"].Text);
- list.Add(ugr.Cells["QLTY_CD_CFNM"].Text);
- list.Add(ugr.Cells["QLTY_UNIT"].Text);
- list.Add(ugr.Cells["QLTY_TYPE"].Text);
- list.Add(ugr.Cells["DISPLAY_SEQ"].Text);
- list.Add(ugr.Cells["QLTY_OPE_CD"].Text);
- list.Add(ugr.Cells["QLTY_DIR"].Text);
- list.Add(ugr.Cells["QLTY_SIZ"].Text);
- list.Add(ugr.Cells["QLTY_TEM"].Text);
- list.Add(ugr.Cells["QLTY_RP"].Text);
- list.Add(ugr.Cells["QLTY_CD_XP"].Text);
- }
- else//插入
- {
- list.Add("UIB100102_01.INSERT");
- list.Add(ugr.Cells["QLTY_CD_1"].Text);
- list.Add(ugr.Cells["QLTY_CD_2"].Text);
- list.Add(ugr.Cells["QLTY_CD_2_NM"].Text);
- list.Add(ugr.Cells["QLTY_CD_3"].Text);
- list.Add(ugr.Cells["QLTY_CD_3_NM"].Text);
- list.Add(ugr.Cells["QLTY_CD"].Text);
- list.Add(ugr.Cells["QLTY_CD_CFNM"].Text);
- list.Add(ugr.Cells["QLTY_UNIT"].Text);
- list.Add(ugr.Cells["QLTY_TYPE"].Text);
- list.Add(ugr.Cells["DISPLAY_SEQ"].Text);
- list.Add(ugr.Cells["QLTY_OPE_CD"].Text);
- list.Add(ugr.Cells["QLTY_DIR"].Text);
- list.Add(ugr.Cells["QLTY_SIZ"].Text);
- list.Add(ugr.Cells["QLTY_TEM"].Text);
- list.Add(ugr.Cells["QLTY_RP"].Text);
- }//更新或插入判断结束
- al.Add(list);
- }//CHK判断结束
- }//grid循环判断结束
- if (al.Count == 0) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.JHY.JHYComSave";
- ccp.MethodName = "doSimpleSave";
- ccp.ServerParams = new object[] { al };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.DoQuery();
- }
- catch (Exception ex)
- {
- }
- }
- public void DoDelete()
- {
- try
- {
- //if (this.UserInfo.GetUserID() != "1"
- // && this.UserInfo.GetUserID() != "zw"
- // && this.UserInfo.GetUserID() != "lyb"
- // && this.UserInfo.GetUserID() != "jc190") { MessageBox.Show("无修改权限!禁止修改!", "提示"); return; }
- if (MessageBox.Show("确定删除?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- ArrayList al = new ArrayList();
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text))
- {
- ArrayList list = new ArrayList();
- list.Add("UIB100102_01.DELETE");
- list.Add(ugr.Cells["QLTY_CD"].Text.Trim());
- al.Add(list);
- }
- }
- if (al.Count == 0) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.JHY.JHYComSave";
- ccp.MethodName = "doSimpleSave";
- ccp.ServerParams = new object[] { al };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.DoQuery();
- }
- catch (Exception ex)
- {
- }
- }
- }
- }
|