| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using Infragistics.Win.UltraWinGrid;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using System.Collections;
- namespace Core.LZMes.Client.UIB
- {
- public partial class UIB030240 : FrmBase
- {
- public UIB030240()
- {
- InitializeComponent();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "Send":
- this.DoSend();
- break;
- case "Save":
- this.DoSave();
- break;
- case "Cancer":
- this.DoCancer();
- break;
- }
- }
- public void DoQuery()
- {
- try
- {
- ArrayList al = new ArrayList();
- if (this.comboBox3.Text == "连退")
- {
- al.Add("UIB030230_YC_02.SELECT");
- }
- else
- {
- al.Add("UIB030240_YC_02.SELECT");
- }
- //al.Add("UIB030230_YC_02.SELECT");
- al.Add("");
- this.dataSet1.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- }
- catch (Exception ex)
- {
- }
- }
- public void DoSend()
- {
- try
- {
- if (MessageBox.Show("确定发送指示到检化验中心?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true")
- {
- //发送
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", ugr.Cells["SMP_NO"].Text);
- ht.Add("o2", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- if (this.comboBox3.Text == "连退")
- {
- ccp.ServerParams = new object[] { "UIB030230_YCCD_FS.CALL", ht };
- }
- else
- {
- ccp.ServerParams = new object[] { "UIB030240_YCCD_FS.CALL", ht };
- }
-
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && err[0] != null)
- {
- string retInfo = err[0].ToString().Trim();
- if (!"YY".Equals(retInfo))
- {
- System.Windows.Forms.MessageBox.Show(retInfo);
- }
- }
- }
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- }
- }
- public void DoSave()
- {
- try
- {
- if (MessageBox.Show("确定做材质判定?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- //判定
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- //ht.Add("i1", ugr.Cells["OLD_SAMPL_NO"].Text);
- ht.Add("i1", this.UserInfo.GetUserID());
- ht.Add("o2", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- if (this.comboBox3.Text == "连退")
- {
- ccp.ServerParams = new object[] { "UIB030230_CDGP_DCS.CALL", ht };
- }
- else
- {
- ccp.ServerParams = new object[] { "UIB030240_CDGP_DCS.CALL", ht };
- }
-
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && err[0] != null)
- {
- string retInfo = err[0].ToString().Trim();
- if (!"YY".Equals(retInfo))
- {
- System.Windows.Forms.MessageBox.Show(retInfo);
- return;
- }
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- }
- }
- public void DoCancer()
- {
- try
- {
- if (MessageBox.Show("确定要取消钢卷改判吗?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- return;
- foreach (UltraGridRow ugr in this.ultraGrid1.Rows)
- {
- if (ugr.Cells["CHK"].Text.ToLower() == "true")
- {
- if (ugr.Cells["SMP_STATS"].Text == "1")
- {
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", ugr.Cells["OLD_SAMPL_NO"].Value.ToString());
- ht.Add("i2", ugr.Cells["SMP_NO"].Value.ToString());
- ht.Add("i3", ugr.Cells["ORG_SMP_NO"].Value.ToString());
- ht.Add("i4", ugr.Cells["ORG_SMP_CUT_LOC"].Value.ToString());
- ht.Add("i5", ugr.Cells["OLD_PRDNM_CD"].Value.ToString());
- ht.Add("i6", ugr.Cells["OLD_SPEC_ABBSYM"].Value.ToString());
- ht.Add("i7", ugr.Cells["OLD_SPEC_STL_GRD"].Value.ToString());
- ht.Add("i8", ugr.Cells["OLD_ORD_USE_CD"].Value.ToString());
- ht.Add("i9", this.UserInfo.GetUserID());
- ht.Add("o10", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- if (this.comboBox3.Text == "连退")
- {
- ccp.ServerParams = new object[] { "UIB030230_YCCD_CANCER.CALL", ht };
- }
- else
- {
- ccp.ServerParams = new object[] { "UIB030240_YCCD_CANCER.CALL", ht };
- }
-
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && err[0] != null)
- {
- string retInfo = err[0].ToString().Trim();
- if (!"YY".Equals(retInfo))
- {
- System.Windows.Forms.MessageBox.Show(retInfo);
- }
- }
- }
- else
- {
- MessageBox.Show("请选择改判状态为1的钢卷!", "提示");
- break;
- }
- }
-
- }
- this.DoQuery();
- }
- catch (Exception ex)
- {
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- //钢卷原始检验信息
- if (this.ultraGrid1.ActiveRow == null) return;
- ArrayList al = new ArrayList();
- al.Add("UIB030230_04.SELECT");
- al.Add(this.ultraGrid1.ActiveRow.Cells["ORG_SMP_NO"].Text.ToString());
- al.Add(this.ultraGrid1.ActiveRow.Cells["ORG_SMP_CUT_LOC"].Text.ToString());
- this.dataSet2.Tables[0].Clear();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "UIB.COM.ComDBQuery";
- ccp.MethodName = "doSimpleQuery";
- ccp.ServerParams = new object[] { al };
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- this.grid3Data();
- }
- catch (Exception ex)
- {
- }
- }
- public void grid3Data()
- {
- //钢卷改判后的检验信息
- ArrayList al1 = new ArrayList();
- al1.Add("UIB030230_04.SELECT");
- al1.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text.ToString());
- al1.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text.ToString());
- this.dataSet3.Tables[0].Clear();
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "UIB.COM.ComDBQuery";
- ccp1.MethodName = "doSimpleQuery";
- ccp1.ServerParams = new object[] { al1 };
- ccp1.SourceDataTable = this.dataSet3.Tables[0];
- this.ExecuteQueryToDataTable(ccp1, CoreInvokeType.Internal);
- }
- private void ultraGrid3_ClickCell_1(object sender, ClickCellEventArgs e)
- {
- try
- {
- if (this.ultraGrid1.ActiveRow == null || this.ultraGrid3.ActiveRow == null) return;
- string clickColumnID = this.ultraGrid3.ActiveCell.Column.Key;
- if (clickColumnID.Equals("XMTH"))
- {
- //弹出界面选择要替换的项目值
- CUIB030240 CWindow = new CUIB030240();
- CWindow.ob = this.ob;
- CWindow.Text = "可供替换的检验项目值(被替换项目:" + this.ultraGrid3.ActiveRow.Cells["QLTY_CD_CFNM"].Text + ")";
- CWindow.ORG_SMP_NO = this.ultraGrid1.ActiveRow.Cells["ORG_SMP_NO"].Text.ToString();
- CWindow.ORG_SMP_NO_LOT = this.ultraGrid1.ActiveRow.Cells["ORG_SMP_CUT_LOC"].Text.ToString();
- CWindow.QLTY_CD_GP = this.ultraGrid3.ActiveRow.Cells["QLTY_CD"].Text.ToString();
- CWindow.QLTY_CD_GPN = this.ultraGrid3.ActiveRow.Cells["QLTY_CD_CFNM"].Text.ToString();
- //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托
- if (CWindow.ShowDialog() == DialogResult.OK)
- {
- string qlty_cd_val = CWindow.al.GetByIndex(0).ToString();
- string qlty_cd_0 = CWindow.al.GetKey(0).ToString();
- //发送
- CoreClientParam ccp = new CoreClientParam();
- Hashtable ht = new Hashtable();
- ht.Add("i1", this.ultraGrid1.ActiveRow.Cells["OLD_SAMPL_NO"].Text.ToString());
- ht.Add("i2", this.ultraGrid3.ActiveRow.Cells["QLTY_CD"].Text); //原来的材质
- ht.Add("i3", qlty_cd_0); //替换的材质项目
- ht.Add("i4", qlty_cd_val); //替换的材质项目值
- ht.Add("o5", "");
- ccp.ServerName = "UIB.COM.ComDBProcedure";
- ccp.MethodName = "doXmlProcedure";
- if (this.comboBox3.Text == "连退")
- {
- ccp.ServerParams = new object[] { "UIB030230_YCCD_XMTH.CALL", ht };
- }
- else
- {
- ccp.ServerParams = new object[] { "UIB030240_YCCD_XMTH.CALL", ht };
- }
-
- this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- System.Collections.ArrayList err = ccp.ReturnObject as System.Collections.ArrayList;
- if (err != null && err.Count > 0 && err[0] != null)
- {
- string retInfo = err[0].ToString().Trim();
- if ("YY".Equals(retInfo))
- {
- this.grid3Data();
- }
- else if ("OK".Equals(retInfo))
- {
- this.DoQuery();
- } else
- {
- System.Windows.Forms.MessageBox.Show(retInfo);
- this.DoQuery();
- }
- }
- }
- CWindow.Dispose();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- }
- }
- private void UIB030240_Load(object sender, EventArgs e)
- {
- this.comboBox3.SelectedIndex = 0;
- }
- }
- }
|