| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- 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;
- namespace Core.LZMes.Client.UIB
- {
- public partial class UIB030120 : FrmBase
- {
- private string ComServerClassName = "UIB.COM.ComDBQuery";
- public UIB030120()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.DoSave();
- break;
- }
- }
- public void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ArrayList al = new ArrayList();
- if (this.comboBox3.Text == "")
- {
- MessageBox.Show("请选择产线!", "提示");
- return;
- }
- if (this.comboBox3.Text == "酸洗")
- {
- if (this.ultraComboEditor1.Value.ToString() == "")//无条件查询
- {
- al.Add("UIB030120_04.SELECT");
- }
- else//试样检验待机或试样判定待机
- {
- al.Add("UIB030120_05.SELECT");
- al.Add(this.ultraComboEditor1.Value.ToString());
- }
- }
- else
- {
- if (this.ultraComboEditor1.Value.ToString() == "")//无条件查询
- {
- al.Add("UIB030120_01.SELECT");
- }
- else//试样检验待机或试样判定待机
- {
- al.Add("UIB030120_02.SELECT");
- al.Add(this.ultraComboEditor1.Value.ToString());
- }
- }
- ccp.ServerName = ComServerClassName;
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] {al};
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch(Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- public void DoSave()
- {
- }
- private void UIB020330_Load(object sender, EventArgs e)
- {
- this.ultraComboEditor1.SelectedIndex = 0;
- this.comboBox3.SelectedIndex = 0;
- }
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- // if(e.Cell.Column.Key=)
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- if (this.ultraGrid1.ActiveRow == null) return;
- //if (this.ultraGrid1.ActiveRow.Selected == false) return;
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ArrayList al = new ArrayList();
- al.Add("UIB030120_03.SELECT");
- al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Value.ToString());
- al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Value.ToString());
- ccp.ServerName = ComServerClassName;
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al};
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp , CoreInvokeType.Internal);
- }
- private void ultraGrid2_KeyDown(object sender, KeyEventArgs e)
- {
- try
- {
- if (e.KeyCode != Keys.Enter) return;//回车时,才保存数据
- if (this.ultraGrid2.ActiveCell == null) return;
- if (this.ultraGrid2.ActiveCell.DataChanged == true)//数据有修改时才执行update操作
- {
- Hashtable ht = new Hashtable();
- ht.Add("i1", this.ultraGrid2.ActiveRow.Cells["SMP_NO"].Text);
- ht.Add("i2", this.ultraGrid2.ActiveRow.Cells["SMP_CUT_LOC"].Text);
- ht.Add("i3", this.ultraGrid2.ActiveRow.Cells["QLTY_CD"].Text);
- ht.Add("i4", this.ultraGrid2.ActiveRow.Cells["QLTY_SEQ"].Text);
- ht.Add("i5", this.ultraGrid2.ActiveRow.Cells["QLTY_VAL_WK"].Text);
- ht.Add("i6", this.UserInfo.GetUserID());
- ht.Add("o7", "");
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- ccp.ServerParams = new object[] { "UIB030120_01.CALL", ht };
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- }
- //换行,并编辑
- this.ultraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow);
- this.ultraGrid2.ActiveRow.Cells["QLTY_VAL_WK"].Activate();
- this.ultraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- DoSave();
- }
- }
- }
|