| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- 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.UIF
- {
- public partial class UIF042010 : FrmBase
- {
- string thd_grp_cd = "";
- string wth_grp_cd = "";
- public UIF042010()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Save":
- this.update01();
- break;
- case "cancel":
- this.update02();
- break;
- case "confirm":
- this.update03();
- break;
- }
- }
- private void DoQuery()
- {
- try
- {
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "query01";
- ccp.ServerParams = new object[] {};
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Console.WriteLine(this.dataSet1.Tables[0].ToString());
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- string columnID = Convert.ToString(this.楷.ActiveCell.Column.Key);
- if(columnID.Substring(4,3).Equals("CNT"))
- {
- //宽度组上下限
- string grpWthMin = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_MINI"].Value);
- string grpWthMax = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_MAXI"].Value);
- //厚度组上下限
- this.thd_grp_cd = columnID.Substring(0, 3);
- this.wth_grp_cd = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_GRP_CD"].Value);
- string columnKey01 = columnID.Substring(0, 4) + "CNT";
- string columnKey02 = columnID.Substring(0, 4) + "WGT";
- string grpThkMin = Convert.ToString(this.楷.Rows[0].Cells[columnKey01].Value);
- string grpThkMax = Convert.ToString(this.楷.Rows[0].Cells[columnKey02].Value);
- string stl_grd = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_stl.Text));
- string ord_no = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_ord_no.Text));
- string ord_seq = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_ord_seq.Text));
- string entry_time = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_entry_dtime.Text));
- string cur_loc = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_cur_loc.Text));
- string prod_line = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_prod_line.Text));
- string exshape_grd = Convert.ToString(Common.FixDBManager.CheckNullStr(this.combo_exshape_grd.Text));
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "query02";
- ccp.ServerParams = new object[] { cur_loc, ord_no, ord_seq, entry_time, exshape_grd, stl_grd, prod_line, grpThkMin, grpThkMax, grpWthMin, grpWthMax };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Console.WriteLine(this.dataSet2.Tables[0].ToString());
- }else if(columnID.Substring(4,3).Equals("WGT")){
- this.thd_grp_cd = columnID.Substring(0, 3);
- this.wth_grp_cd = Convert.ToString(this.楷.ActiveCell.Row.Cells["WTH_GRP_CD"].Value);
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "query03";
- ccp.ServerParams = new object[] { thd_grp_cd, wth_grp_cd };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- Console.WriteLine(this.dataSet2.Tables[0].ToString());
- }
- }
- private void update01()
- {
- try
- {
- ArrayList chk = new ArrayList();
- ArrayList coil_no = new ArrayList();
- System.Data.DataRow[] row = this.dataSet2.Tables[0].Select("CHK='true'");
- int len = row.Length;
- for (int i = 0; i < len; i++)
- {
- chk.Add(row[i]["CHK"]);
- coil_no.Add(row[i]["COIL_NO"]);
- }
-
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "update01";
- ccp.ServerParams = new object[] {coil_no,this.thd_grp_cd,this.wth_grp_cd};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //if (ccp.ReturnCode != 0) return;
- this.dataSet2.Tables[0].Clear();
- DoQuery();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void update02()
- {
- try
- {
- ArrayList chk = new ArrayList();
- ArrayList coil_no = new ArrayList();
- System.Data.DataRow[] row = this.dataSet2.Tables[0].Select("CHK='true'");
- int len = row.Length;
- for (int i = 0; i < len; i++)
- {
- chk.Add(row[i]["CHK"]);
- coil_no.Add(row[i]["COIL_NO"]);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "update02";
- ccp.ServerParams = new object[] { coil_no};
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //if (ccp.ReturnCode != 0) return;
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- //confirm pltcm_indication
- private void update03()
- {
- try
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIF.UIF04.UIF042010";
- ccp.MethodName = "update03";
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- //if (ccp.ReturnCode != 0) return;
- this.dataSet1.Tables[0].Clear();
- this.dataSet2.Tables[0].Clear();
- }
- catch (Exception EX)
- {
- MessageBox.Show(EX.ToString());
- }
- }
- private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- this.ultraGrid2.Update();
- }
- }
- }
|