using Core.Mes.Client.Comm; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.Judge.Controls; using CoreFS.CA06; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Core.StlMes.Client.Judge.Forms { public partial class QcmZbsInfoInput : FrmBase { public QcmZbsInfoInput() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": Query(); break; case "Add": Add(); break; case "Update": Update(); break; case "Delete": Delete(); break; case "savePhyInfo": savePhyInfo(); break; case "DeletePhyInfo": DeletePhyInfo(); break; case "saveChemInfo": saveChemInfo(); break; case "DeleteChemInfo": DeleteChemInfo(); break; case "Close": this.Close(); break; } } private void Query() { string judgeNo = ""; string orderStart = ""; string orderEnd = ""; if (ckJudgeNo.Checked) judgeNo = utJudgeNo.Text.Trim(); if (uchkDate.Checked) { orderStart = udtStart.DateTime.ToString("yyyy-MM-dd") + " 00:00:01"; orderEnd = udtEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59"; } else { orderStart = "1000-01-01 00:00:01"; orderEnd = "9999-12-31 23:59:59"; } DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getZbsInfo", new Object[] { judgeNo, orderStart, orderEnd }, this.ob); GridHelper.CopyDataToDatatable(ref dt, ref this.zbsInfo, true); GridHelper.RefreshAndAutoSize(this.ultraGrid1); } private void Add() { ZbsChooseBillInfo choose = new ZbsChooseBillInfo(this.ob); choose.ShowDialog(); if (choose.CloseEvent.Equals("Add")) { this.Query(); } } private void Update() { try { ultraGrid1.UpdateData(); if (ultraGrid1.ActiveRow == null) return; UltraGridRow row = ultraGrid1.ActiveRow; if ("".Equals(row.Cells["JUDGE_STOVE_NO"].Value.ToString())) { MessageUtil.ShowTips("判定炉号不能为空"); return; } if ("".Equals(row.Cells["BATCH_NO"].Value.ToString())) { MessageUtil.ShowTips("批号不能为空"); return; } DateTime date = new DateTime(); if (!DateTime.TryParse(row.Cells["CREATE_TIME"].Value.ToString(), out date)) { MessageUtil.ShowTips("创建时间错误"); return; } ArrayList list = new ArrayList(); list.Add(row.Cells["ACT_COUNT"].Value.ToString()); list.Add(row.Cells["ACT_THEORY_WEIGHT"].Value.ToString()); list.Add(row.Cells["ACT_WEIGHT"].Value.ToString()); list.Add(row.Cells["BATCH_NO"].Value.ToString()); list.Add(row.Cells["CHEM_RESULT"].Value.ToString()); list.Add(row.Cells["CREATE_NAME"].Value.ToString()); list.Add(row.Cells["CREATE_TIME"].Value.ToString()); list.Add(row.Cells["CUSTM_ORDER_NO"].Value.ToString()); list.Add(row.Cells["CUSTOMER_NM"].Value.ToString()); list.Add(row.Cells["CUSTOMER_NO"].Value.ToString()); list.Add(row.Cells["CUT_NUM"].Value.ToString()); list.Add(row.Cells["DELIVERY_STATE_CODE"].Value.ToString()); list.Add(row.Cells["DELIVERY_STATE_NAME"].Value.ToString()); list.Add(row.Cells["DETECT_RESULT"].Value.ToString()); list.Add(row.Cells["DETECT_RESULT2"].Value.ToString()); list.Add(row.Cells["FACE_RESULT"].Value.ToString()); list.Add(row.Cells["FLAG"].Value.ToString()); list.Add(row.Cells["GRADECODE"].Value.ToString()); list.Add(row.Cells["GRADENAME"].Value.ToString()); list.Add(row.Cells["JUDGE_RESULT"].Value.ToString()); list.Add(row.Cells["JUDGE_STOVE_NO"].Value.ToString()); list.Add(row.Cells["LEN_DESC"].Value.ToString()); list.Add(row.Cells["LEN_MAX"].Value.ToString()); list.Add(row.Cells["LEN_MIN"].Value.ToString()); list.Add(row.Cells["LEN_MIN_MAX_UNIT"].Value.ToString()); list.Add(row.Cells["LEN_NO"].Value.ToString()); list.Add(row.Cells["LEN_UNIT"].Value.ToString()); list.Add(row.Cells["LOT_NO"].Value.ToString()); list.Add(row.Cells["LOT_NO_GROUP"].Value.ToString()); list.Add(row.Cells["MEMO"].Value.ToString()); list.Add(row.Cells["MODEL_CODE"].Value.ToString()); list.Add(row.Cells["MODEL_DESC"].Value.ToString()); list.Add(row.Cells["ORDER_NO"].Value.ToString()); list.Add(row.Cells["ORDER_SEQ"].Value.ToString()); list.Add(row.Cells["ORDER_SPEC_CODE"].Value.ToString()); list.Add(row.Cells["ORDER_SPEC_DESC"].Value.ToString()); list.Add(row.Cells["ORD_LN_DLY_PK"].Value.ToString()); list.Add(row.Cells["ORD_LN_PK"].Value.ToString()); list.Add(row.Cells["OUTPUT_STD_NO"].Value.ToString()); list.Add(row.Cells["PHY_RESULT"].Value.ToString()); list.Add(row.Cells["PLINE_CODE"].Value.ToString()); list.Add(row.Cells["PROCESS_DESC"].Value.ToString()); list.Add(row.Cells["PROCESS_DESC"].Text); list.Add(row.Cells["PROCESS_RESULT"].Value.ToString()); list.Add(row.Cells["PRODUCCODE"].Value.ToString()); list.Add(row.Cells["PRODUCNAME"].Value.ToString()); list.Add(row.Cells["RECEIV_NM"].Value.ToString()); list.Add(row.Cells["RECEIV_NO"].Value.ToString()); list.Add(row.Cells["SPEC_CODE"].Value.ToString()); list.Add(row.Cells["SPEC_NAME"].Value.ToString()); list.Add(row.Cells["SPEC_RESULT"].Value.ToString()); list.Add(row.Cells["STD_CODE"].Value.ToString()); list.Add(row.Cells["STD_NAME"].Value.ToString()); list.Add(row.Cells["STD_STYLE"].Value.ToString()); list.Add(row.Cells["STD_STYLE_DESC"].Value.ToString()); list.Add(row.Cells["STEELCODE"].Value.ToString()); list.Add(row.Cells["STEELNAME"].Value.ToString()); list.Add(row.Cells["STOVE_NO"].Value.ToString()); list.Add(row.Cells["USE_CODE"].Value.ToString()); list.Add(row.Cells["USE_DESC"].Value.ToString()); list.Add(row.Cells["WATER_RESULT"].Value.ToString()); list.Add(row.Cells["WO_ID"].Value.ToString()); list.Add(row.Cells["ZBS_ADD_ASK_DESC"].Value.ToString()); list.Add(row.Cells["ZBS_MEMO"].Value.ToString()); list.Add(row.Cells["ZBS_MEMO_JG"].Value.ToString()); list.Add(row.Cells["ZBS_ID"].Value.ToString()); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "saveZbsInfo"; ccp.ServerParams = new object[] { list }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } catch (Exception ex) { MessageBox.Show("保存失败,原因:" + ex.Message); } Query(); } private void Delete() { if (ultraGrid1.ActiveRow==null) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "doDeleteZbsInfo"; ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } private void QueryChemInfo() { if (ultraGrid1.ActiveRow == null) return; DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getChemInfo", new Object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }, this.ob); GridHelper.CopyDataToDatatable(ref dt, ref this.zbsChem, true); GridHelper.RefreshAndAutoSize(this.ultraGrid3); } private void saveChemInfo() { try { ultraGrid3.UpdateData(); if (ultraGrid1.ActiveRow == null) return; if (ultraGrid3.Rows.Count <= 0) return; ArrayList parm = new ArrayList(); foreach (UltraGridRow row in ultraGrid3.Rows) { ArrayList list = new ArrayList(); list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString()); list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString()); list.Add(row.Cells["SAMPLE_NO"].Value.ToString()); list.Add(row.Cells["PROCESS_CODE"].Value.ToString()); list.Add(row.Cells["CHEM_TYPE"].Value.ToString()); list.Add(row.Cells["CHEM_NAME"].Value.ToString()); list.Add(row.Cells["CHEM_VALUE"].Value.ToString()); list.Add(row.Cells["NK_MIN"].Value.ToString()); list.Add(row.Cells["NK_MAX"].Value.ToString()); list.Add("1"); list.Add(row.Cells["JF_MIN"].Value.ToString()); list.Add(row.Cells["JF_MAX"].Value.ToString()); list.Add("1"); list.Add(row.Cells["ROUND"].Value.ToString()); list.Add(row.Cells["SAMPLE_ID"].Value.ToString()); list.Add(ultraGrid1.ActiveRow.Cells["JUDGE_STOVE_NO"].Value.ToString()); parm.Add(list); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "saveChemInfo"; ccp.ServerParams = new object[] { parm, ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } catch (Exception ex) { MessageBox.Show("保存失败,原因:" + ex.Message); } } private void DeleteChemInfo() { if (ultraGrid1.ActiveRow == null) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "DeleteChemInfo"; ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString(), ultraGrid3.ActiveRow.Cells["ZBS_SEQ"].Value.ToString()}; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } private void QueryPhyInfo() { if (ultraGrid1.ActiveRow == null) return; DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getPhyInfo", new Object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }, this.ob); GridHelper.CopyDataToDatatable(ref dt, ref this.zbsPhy, true); GridHelper.RefreshAndAutoSize(this.ultraGrid2); } private void savePhyInfo() { try { ultraGrid2.UpdateData(); if (ultraGrid1.ActiveRow == null) return; if (ultraGrid2.Rows.Count <= 0) return; ArrayList parm = new ArrayList(); foreach (UltraGridRow row in ultraGrid2.Rows) { if ("".Equals(row.Cells["SAMPLE_NO"].Value.ToString())) { MessageUtil.ShowTips("试样号不能为空"); return; } if ("".Equals(row.Cells["PROCESS_CODE"].Value.ToString())) { MessageUtil.ShowTips("工序代码不能为空"); return; } if ("".Equals(row.Cells["PHY_CODE_MAX"].Value.ToString())) { MessageUtil.ShowTips("检验大项不能为空"); return; } if ("".Equals(row.Cells["PHY_CODE_MIN"].Value.ToString())) { MessageUtil.ShowTips("试样组不能为空"); return; } if ("".Equals(row.Cells["PHY_CODE"].Value.ToString())) { MessageUtil.ShowTips("检验项不能为空"); return; } ArrayList list = new ArrayList(); list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString()); list.Add(ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString()); list.Add(row.Cells["AUDIT_NAME"].Value.ToString()); //list.Add(row.Cells["AUDIT_TIME"].Value.ToString()); list.Add(row.Cells["AVERAGE"].Value.ToString()); list.Add(row.Cells["AVERAGE_VALUE_F"].Value.ToString()); list.Add(row.Cells["CHECK_NAME"].Value.ToString()); list.Add(row.Cells["CHECK_TEMP"].Value.ToString()); //list.Add(row.Cells["CHECK_TIME"].Value.ToString()); list.Add(row.Cells["DEVICE_NAME"].Value.ToString()); list.Add(row.Cells["DEVICE_NO"].Value.ToString()); list.Add(row.Cells["FORMUAL_NAME"].Value.ToString()); list.Add(row.Cells["FORMUAL_NO"].Value.ToString()); list.Add(row.Cells["HARDNESS_TYPE"].Value.ToString()); list.Add(row.Cells["ISRCL"].Value.ToString()); list.Add(""); list.Add(""); //list.Add(row.Cells["IS_DEFECT"].Value.ToString()); //list.Add(row.Cells["IS_GOOD"].Value.ToString()); list.Add(row.Cells["ITEM_CODE_F"].Value.ToString()); list.Add(row.Cells["ITEM_CODE_S"].Value.ToString()); list.Add(row.Cells["ITEM_CODE_W"].Value.ToString()); list.Add(row.Cells["ITEM_NAME_F"].Value.ToString()); list.Add(row.Cells["ITEM_NAME_S"].Value.ToString()); list.Add(row.Cells["ITEM_NAME_W"].Value.ToString()); list.Add(row.Cells["JF_ADD_CONDITION"].Value.ToString()); list.Add(row.Cells["JF_ADD_JUDGE_BASIS"].Value.ToString()); list.Add(row.Cells["JF_ADD_MAX"].Value.ToString()); list.Add(row.Cells["JF_ADD_MIN"].Value.ToString()); list.Add(row.Cells["JF_JUDGE_BASIS"].Value.ToString()); list.Add(row.Cells["JF_MAX"].Value.ToString()); list.Add(row.Cells["JF_MIN"].Value.ToString()); list.Add("1"); //list.Add(row.Cells["JF_TOL_QUALIFIED"].Value.ToString()); list.Add(row.Cells["NK_ADD_CONDITION"].Value.ToString()); list.Add(row.Cells["NK_ADD_JUDGE_BASIS"].Value.ToString()); list.Add(row.Cells["NK_ADD_MAX"].Value.ToString()); list.Add(row.Cells["NK_ADD_MIN"].Value.ToString()); list.Add(row.Cells["NK_JUDGE_BASIS"].Value.ToString()); list.Add(row.Cells["NK_MAX"].Value.ToString()); list.Add(row.Cells["NK_MIN"].Value.ToString()); list.Add("1"); //list.Add(row.Cells["NK_TOL_QUALIFIED"].Value.ToString()); list.Add(row.Cells["PHY_CODE"].Value.ToString()); list.Add(row.Cells["PHY_CODE_DIR"].Value.ToString()); list.Add(row.Cells["PHY_CODE_MAX"].Value.ToString()); list.Add(row.Cells["PHY_CODE_MIN"].Value.ToString()); list.Add(row.Cells["PHY_NAME"].Value.ToString()); list.Add(row.Cells["PHY_NAME_DIR"].Value.ToString()); list.Add(row.Cells["PHY_NAME_MAX"].Value.ToString()); list.Add(row.Cells["PHY_NAME_MIN"].Value.ToString()); list.Add(row.Cells["PROCESS_CODE"].Value.ToString()); list.Add(row.Cells["REMARK"].Value.ToString()); list.Add(row.Cells["SAMPLE_ID"].Value.ToString()); list.Add(row.Cells["SAMPLE_NO"].Value.ToString()); list.Add(row.Cells["SAMPLE_SIZE"].Value.ToString()); list.Add(row.Cells["SAMPLE_STYLE"].Value.ToString()); list.Add(row.Cells["SIZE_DESC"].Value.ToString()); list.Add(row.Cells["VALUE1"].Value.ToString()); list.Add(row.Cells["VALUE10"].Value.ToString()); list.Add(row.Cells["VALUE11"].Value.ToString()); list.Add(row.Cells["VALUE12"].Value.ToString()); list.Add(row.Cells["VALUE13"].Value.ToString()); list.Add(row.Cells["VALUE14"].Value.ToString()); list.Add(row.Cells["VALUE15"].Value.ToString()); list.Add(row.Cells["VALUE2"].Value.ToString()); list.Add(row.Cells["VALUE3"].Value.ToString()); list.Add(row.Cells["VALUE4"].Value.ToString()); list.Add(row.Cells["VALUE5"].Value.ToString()); list.Add(row.Cells["VALUE6"].Value.ToString()); list.Add(row.Cells["VALUE7"].Value.ToString()); list.Add(row.Cells["VALUE8"].Value.ToString()); list.Add(row.Cells["VALUE9"].Value.ToString()); list.Add(row.Cells["VALUE_F2"].Value.ToString()); list.Add(row.Cells["VALUE_F3"].Value.ToString()); list.Add(row.Cells["VALUE_KSI"].Value.ToString()); list.Add(row.Cells["VALUE_PSI"].Value.ToString()); parm.Add(list); } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "savePhyInfo"; ccp.ServerParams = new object[] { parm, ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } catch (Exception ex) { MessageBox.Show("保存失败,原因:" + ex.Message); } } private void DeletePhyInfo() { if (ultraGrid1.ActiveRow == null) return; CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "com.steering.pss.judge.DAL.ZbsInfoInput"; ccp.MethodName = "DeletePhyInfo"; ccp.ServerParams = new object[] { ultraGrid1.ActiveRow.Cells["ZBS_ID"].Value.ToString() , ultraGrid2.ActiveRow.Cells["ZBS_SEQ"].Value.ToString()}; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } } else { return; } MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Query(); } private void QcmZbsInfoInput_Load(object sender, EventArgs e) { //默认查询当前日期-1月——当前日期数据。 udtStart.DateTime = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToShortDateString()); udtEnd.DateTime = Convert.ToDateTime(DateTime.Now.ToShortDateString()); ValueList list1 = new ValueList(); ValueListItem[] items1 = new ValueListItem[] { new ValueListItem("0", "熔炼成分"), new ValueListItem("1", "成品成分"), }; list1.ValueListItems.AddRange(items1); ultraGrid3.DisplayLayout.Bands[0].Columns["CHEM_TYPE"].ValueList = list1; ValueList list2 = new ValueList(); ValueListItem[] items2 = new ValueListItem[] { new ValueListItem("0", "否"), new ValueListItem("1", "是"), }; list2.ValueListItems.AddRange(items2); ultraGrid2.DisplayLayout.Bands[0].Columns["ISRCL"].ValueList = list2; ValueList list3 = new ValueList(); ValueListItem[] items3 = new ValueListItem[] { new ValueListItem("A", "炼钢"), new ValueListItem("D", "轧制"), new ValueListItem("A", "热处理"), new ValueListItem("G", "加工"), }; list3.ValueListItems.AddRange(items3); ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_DESC"].ValueList = list3; DataTable dtChem = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407401" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["CHEM_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtChem); DataTable dtPhy = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407402" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["PHY_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtPhy); DataTable dtFace = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407406" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["FACE_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtFace); DataTable dtSpec = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407403" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["SPEC_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtSpec); DataTable dtDetect = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407404" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["DETECT_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtDetect); DataTable dtWater = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407405" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["WATER_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtWater); DataTable dtProcess = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407408" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["PROCESS_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtProcess); DataTable dtJudge = ServerHelper.GetData("com.steering.pss.glbusiness.GlOrderManage.getBaseInfo", new object[] { "407407" }, this.ob); ultraGrid1.DisplayLayout.Bands[0].Columns["JUDGE_RESULT"].ValueList = ComHelper.List_GetBaseInfo(dtJudge); DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.ZbsInfoInput.getPlineInfo", new Object[] { }, this.ob); ValueListItem[] items4 = new ValueListItem[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { ValueListItem item = new ValueListItem(); item.DataValue = dt.Rows[i]["pline_code"].ToString(); item.DisplayText = dt.Rows[i]["pline_name"].ToString(); items4[i] = item; } ValueList valueList = new ValueList(); valueList.ValueListItems.AddRange(items4); ultraGrid1.DisplayLayout.Bands[0].Columns["PLINE_CODE"].ValueList = valueList; } private void ckJudgeNo_CheckedChanged(object sender, EventArgs e) { if (ckJudgeNo.Checked) utJudgeNo.ReadOnly = false; else utJudgeNo.ReadOnly = true; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { zbsChem.Clear(); zbsPhy.Clear(); QueryChemInfo(); QueryPhyInfo(); } private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME_MAX") { DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRStd", null, ob); dt.Columns["PHY_TYPE"].Caption = "检验大项"; BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_TYPE", "PHY_CODE"); baseInfoPopup.Text = "检验大项"; baseInfoPopup.LabelTextBox1.Caption = "检验大项"; baseInfoPopup.Shown += new EventHandler((c, d) => { IQueryable rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where( a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX")); if (rows.Count() > 0) { rows.First().Activate(); } }); if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid2.ActiveRow.SetValue("PHY_NAME_MAX", baseInfoPopup.ChoicedRow.GetValue("PHY_TYPE")); ultraGrid2.ActiveRow.SetValue("PHY_CODE_MAX", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE")); ultraGrid2.ActiveRow.SetValue("PHY_NAME_MIN", ""); ultraGrid2.ActiveRow.SetValue("PHY_CODE_MIN", ""); ultraGrid2.ActiveRow.SetValue("PHY_NAME", ""); ultraGrid2.ActiveRow.SetValue("PHY_CODE", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", ""); } } else if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME_MIN") { string phyCodeMax = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX"); if (phyCodeMax == "") { MessageUtil.ShowWarning("请选检验大项!"); return; } DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyC", new object[] { phyCodeMax }, ob); dt.Columns["PHY_TYPE"].Caption = "试样组"; BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_TYPE", "PHY_CODE"); baseInfoPopup.Text = "试样组"; baseInfoPopup.LabelTextBox1.Caption = "试样组"; baseInfoPopup.Shown += new EventHandler((c, d) => { IQueryable rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where( a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN")); if (rows.Count() > 0) { rows.First().Activate(); } }); if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid2.ActiveRow.SetValue("PHY_NAME_MIN", baseInfoPopup.ChoicedRow.GetValue("PHY_TYPE")); ultraGrid2.ActiveRow.SetValue("PHY_CODE_MIN", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE")); ultraGrid2.ActiveRow.SetValue("PHY_NAME", ""); ultraGrid2.ActiveRow.SetValue("PHY_CODE", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", ""); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", ""); } } else if (ultraGrid2.ActiveCell.Column.Key == "PHY_NAME") { string phyCodeMax = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX"); string phyCodeMin = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN"); if (phyCodeMax == "") { MessageUtil.ShowWarning("请选择检验大项"); ultraGrid2.ActiveRow.Cells["PHY_NAME_MAX"].Activate(); return; } else if (phyCodeMin == "") { MessageUtil.ShowWarning("请选择试样组"); ultraGrid2.ActiveRow.Cells["PHY_NAME_MIN"].Activate(); return; } DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhy", new object[] { phyCodeMax, phyCodeMin }, ob); dt.Columns["PHY_NAME"].Caption = "检验项"; BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "PHY_NAME", "PHY_CODE"); baseInfoPopup.Text = "检验项"; baseInfoPopup.LabelTextBox1.Caption = "检验项"; baseInfoPopup.Shown += new EventHandler((c, d) => { IQueryable rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where( a => a.GetValue("PHY_CODE") == ultraGrid2.ActiveRow.GetValue("PHY_CODE")); if (rows.Count() > 0) { rows.First().Activate(); } }); if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid2.ActiveRow.SetValue("PHY_NAME", baseInfoPopup.ChoicedRow.GetValue("PHY_NAME")); ultraGrid2.ActiveRow.SetValue("PHY_CODE", baseInfoPopup.ChoicedRow.GetValue("PHY_CODE")); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", ""); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", ""); } if (baseInfoPopup.ChoicedRow.GetValue("PHY_CODE") == "P0618" || baseInfoPopup.ChoicedRow.GetValue("PHY_CODE") == "P0619") { ultraGrid2.ActiveRow.SetValue("STDMIN_SIGN", "="); ultraGrid2.ActiveRow.SetValue("STDMIN", "否"); } } else if (ultraGrid2.ActiveCell.Column.Key == "ITEM_NAME_F") { string phyTypeC = ultraGrid2.ActiveRow.GetValue("PHY_CODE_MIN"); if (phyTypeC == "") { MessageUtil.ShowWarning("请选择试样组"); ultraGrid2.ActiveRow.Cells["PHY_NAME_MIN"].Activate(); return; } DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRItem", new object[] { phyTypeC }, ob); dt.Columns["ITEM_NAME_F"].Caption = "试验方向"; dt.Columns["ITEM_NAME_C"].Caption = "试验尺寸"; if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0001") { dt.DefaultView.RowFilter = "ITEM_CODE_F IS NOT NULL"; } if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0002") { dt.DefaultView.RowFilter = "ITEM_CODE_C IS NOT NULL AND ITEM_CODE_F IS NOT NULL"; } BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "ITEM_NAME_F", "ITEM_CODE_F", "ITEM_CODE_C"); baseInfoPopup.Text = "试验选择"; baseInfoPopup.LabelTextBox1.Caption = "试验方向"; baseInfoPopup.Shown += new EventHandler((c, d) => { IQueryable rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where( a => a.GetValue("ITEM_CODE_F") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_F") && a.GetValue("ITEM_CODE_C") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_S")); if (rows.Count() > 0) { rows.First().Activate(); } }); if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid2.ActiveRow.SetValue("ITEM_NAME_F", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_F")); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_F", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_F")); ultraGrid2.ActiveRow.SetValue("ITEM_NAME_S", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_C")); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_S", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_C")); } } else if (ultraGrid2.ActiveCell.Column.Key == "ITEM_NAME_W") { string phyCode = ultraGrid2.ActiveRow.GetValue("PHY_CODE"); if (phyCode == "") { MessageUtil.ShowWarning("请选择检验项"); ultraGrid2.ActiveRow.Cells["PHY_NAME"].Activate(); return; } DataTable dt = ServerHelper.GetData("com.steering.pss.qcm.ComBaseQuery.geComBasePhyRPos", new object[] { phyCode }, ob); dt.Columns["ITEM_NAME_W"].Caption = "试验温度"; if (ultraGrid2.ActiveRow.GetValue("PHY_CODE_MAX") == "R0001") { dt.DefaultView.RowFilter = "ITEM_CODE_W IS NOT NULL"; } BaseInfoPopup baseInfoPopup = new BaseInfoPopup(dt, "ITEM_NAME_W", "ITEM_CODE_W"); baseInfoPopup.Text = "试验选择"; baseInfoPopup.LabelTextBox1.Caption = "试验温度"; baseInfoPopup.Shown += new EventHandler((c, d) => { IQueryable rows = baseInfoPopup.ultraGrid1.Rows.AsQueryable().Where( a => a.GetValue("ITEM_CODE_W") == ultraGrid2.ActiveRow.GetValue("ITEM_CODE_W")); if (rows.Count() > 0) { rows.First().Activate(); } }); if (baseInfoPopup.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ultraGrid2.ActiveRow.SetValue("ITEM_NAME_W", baseInfoPopup.ChoicedRow.GetValue("ITEM_NAME_W")); ultraGrid2.ActiveRow.SetValue("ITEM_CODE_W", baseInfoPopup.ChoicedRow.GetValue("ITEM_CODE_W")); } } } private void ultraGrid2_AfterRowInsert(object sender, RowEventArgs e) { ultraGrid2.ActiveRow.SetValue("ISRCL", "0"); } } }