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 Infragistics.Win; using CoreFS.CA06; using Infragistics.Win.UltraWinGrid; using System.Collections; using System.Diagnostics; using Core.LZMes.Client.QCM; namespace Core.LZMes.Client.QCM { public partial class QCM031010 : FrmBase { public QCM031010() { InitializeComponent(); } // public DataSet ds = new DataSet(); private string SLSelected = null; string strQxly = ""; string strMian = ""; string strCe = ""; string strTou = ""; string strDaxiao = ""; string strDuoshao = ""; string strShougan = ""; string strChengdu = ""; string strMemo = ""; string strRepair = ""; string strPrimary_flag = ""; string defect_desc = ""; string strMianval = ""; string strCeval = ""; string strTouval = ""; string strDaxiaoval = ""; string strDuoshaoval = ""; string strShouganval = ""; string strChengduval = ""; string strMemoval = ""; string strRepairval = ""; string strPrimary_flagval = ""; string defect_descval = ""; string count = ""; string strPline_Code = ""; //string strQxly = ""; List a = new List(); int c; int jx = 1; public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query": this.DoQuery(); break; case "Save": this.DoSave(); break; //case "Judge": // Operate(); // break; case "FB": fb(); break; case "Cancel_FB": cancel_fb(); break; //case "FanXiu": // this.FanXiu(); //break; case "Export": this.DoExport(); break; } } private void DoQuery() { try { if (this.checkBox1.Checked) { DateTime dt1 = Convert.ToDateTime(this.ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd")); DateTime dt2 = Convert.ToDateTime(this.ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd")); TimeSpan span = dt2.Subtract(dt1); int dayDiff = span.Days + 1; if (dayDiff < 0 || dayDiff >30) { this.alert("查询时间不能大于30天,请核实查询时间条件!"); return; } } ArrayList al = new ArrayList(); SLSelected = this.comboBox3.Text; if (textBox1.Text == "" && !this.checkBox1.Checked && this.textBox3.Text == "") { MessageBox.Show("请选择查询条件!", "提示"); return; } //SQL if (this.comboBox3.Text == "酸轧") { al.Add("UIB030110_01.SELECT"); al.Add(textBox1.Text.ToString());//轧制单元 } else if (this.comboBox3.Text == "酸洗") { al.Add("UIB030110_11.SELECT"); al.Add(textBox1.Text.ToString());//轧制单元 } else if (this.comboBox3.Text == "连退") //al.Add("UIB030110_01_LIAN.SELECT"); //20151103修改查询sql语句去掉重复的卷 al.Add("UIB030110_01_LIAN_QC.SELECT"); else if (this.comboBox3.Text == "重卷")//重卷 { //20151103修改查询sql语句去掉重复的卷 //al.Add("UIB030110_01_CJ_QC.SELECT"); if (this.checkBox1.Checked) { al.Add("UIB030110_01_CJ.SELECT"); al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd"));//日期 al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd"));//日期 } else { al.Add("UIB030110_03_CJ.SELECT"); } } //查询条件 if (this.comboBox3.Text == "连退" || this.comboBox3.Text == "酸轧" || this.comboBox3.Text == "酸洗") { if (this.checkBox1.Checked) { al.Add(this.ultraDateTimeEditor1.DateTime.ToString("yyyyMMdd") + "000000");//日期 al.Add(this.ultraDateTimeEditor2.DateTime.ToString("yyyyMMdd") + "999999");//日期 } else { al.Add(""); al.Add(""); } } al.Add(this.textBox3.Text.Trim());//钢卷号 if (!this.checkBox1.Checked && this.textBox3.Text.Trim() == "") return; OperateConditionRecode.WriteCondition("UIB030110", this.textBox1.Text.ToString()); OperateConditionRecode.WriteCondition("UIB030110_1", this.comboBox3.SelectedIndex.ToString()); this.dataSet1.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //MessageBox.Show(ccp.ReturnInfo, "调试信息"); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["SMP_DIR_PIC_YN"].Text == "Y" && ugr.Cells["SMP_PICK_YN"].Text == "") { //ugr.Appearance.ForeColor = Color.Red;//字体显示红色 //ugr.Delete(); //ugr.Hidden = true; } //判断人工录入宽度判定值与机器测量宽度实际值之差,若≥10则显示红色 string COILWTH = ugr.Cells["COIL_WTH"].Text; string DCSWTH = ugr.Cells["DCS_WTH"].Text; if (COILWTH != null && COILWTH != "" && DCSWTH != null && DCSWTH != "" && DCSWTH != "0") { double chazhi = double.Parse(DCSWTH) - double.Parse(COILWTH); if (System.Math.Abs(chazhi) >= 10) { ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.Red; ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.Red; } else { ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White; ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } } else { ugr.Cells["COIL_WTH"].Appearance.BackColor = Color.White; ugr.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色 string COILTHK = ugr.Cells["COIL_THK"].Text; string DCSTHK = ugr.Cells["DCS_THK"].Text; if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "" && DCSTHK != "0") { double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK); if (System.Math.Abs(chazhi) >= 0.01) { ugr.Cells["COIL_THK"].Appearance.BackColor = Color.Red; ugr.Cells["DCS_THK"].Appearance.BackColor = Color.Red; } else { ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White; ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } } else { ugr.Cells["COIL_THK"].Appearance.BackColor = Color.White; ugr.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private void fb() { try { if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString() == "重卷") { strPline_Code = "LT1"; } else { strPline_Code = "SZ1"; } List lists = new List(); foreach (UltraGridRow ugr in ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "coiljudge_status_call_commit"; ccp.ServerParams = new object[] { strPline_Code , ugr.Cells["COIL_NO"].Value.ToString() , "" , "" , "" , "" , "" , "Y" , textBox4.Text}; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } } //for (int i = 0; i < lists.Count; i++) //{ // lists[i].Delete(false); //} //DoQuery(); MessageBox.Show("封闭成功!"); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void cancel_fb() { try { if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString() == "重卷") { strPline_Code = "LT1"; } else { strPline_Code = "SZ1"; } List lists = new List(); foreach (UltraGridRow ugr in ultraGrid1.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "coiljudge_status_call_commit"; ccp.ServerParams = new object[] { strPline_Code , ugr.Cells["COIL_NO"].Value.ToString() , "" , "" , "" , "" , "" , "N" , textBox4.Text,""}; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } lists.Add(ugr); } } for (int i = 0; i < lists.Count; i++) { lists[i].Delete(false); } //DoQuery(); MessageBox.Show("解除封闭成功!"); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoSave() { try { //this.ultraGrid1.UpdateData();//选择以后,这里必须要updatedata。 ArrayList list = new ArrayList(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Value)) { /*if (ugr.Cells["EXSHAPE_TP"].Text.ToString() == "Y" || ugr.Cells["CRK_TP"].Text.ToString() == "Y") { ArrayList list1 = new ArrayList(); List list2 = new List(); string is_pass = ""; string is_zl1 = ""; list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add("");//检验结果代码 list1.Add("");//检验结果 list1.Add(ultraComboEditor1.Text.Trim().ToString());//质量等级代码 list1.Add(ultraComboEditor1.Text.Trim().ToString());//质量等级名称 list1.Add(""); list1.Add(this.UserInfo.GetUserName());//操作人 list1.Add(this.UserInfo.GetUserOrderText());//班次 list1.Add(this.UserInfo.GetUserGroupText());//班组 int count1 = 0; int i = 0; for (int c1 = 0; c1 < c; c1++) { // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2)); if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != "") { string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString().Split(';'); defect_desc = sArray[0]; strRepair = sArray[1]; strPrimary_flag = sArray[2]; strMian = sArray[3]; strTou = sArray[4]; strCe = sArray[5]; strDaxiao = sArray[6]; strDuoshao = sArray[7]; strChengdu = sArray[8]; strMemo = sArray[9]; defect_descval = sArray[10]; strRepairval = sArray[11]; strPrimary_flagval = sArray[12]; strMianval = sArray[13]; strCeval = sArray[15]; strTouval = sArray[14]; strDaxiaoval = sArray[16]; strDuoshaoval = sArray[17]; strChengduval = sArray[18]; strMemoval = sArray[19]; ArrayList listbm = new ArrayList(); if (strPrimary_flag == "") { listbm.Add(strPrimary_flag); } else { listbm.Add(strPrimary_flagval); } //int j = c1+1; if (strPrimary_flag == "1" && c1 + 1 == 1) { i++; listbm.Add("1"); //j = j - 1; } else if (strPrimary_flag == "1" && c1 + 1 != 1) { MessageBox.Show("请把序号为1的缺陷选为主要缺陷!"); return; } else { listbm.Add(Convert.ToString(c1 + 1)); } if (defect_desc == "") { listbm.Add(defect_desc); } else { listbm.Add(defect_descval); } listbm.Add(defect_desc); if (strMian == "上表面") { listbm.Add("U"); } else if (strMian == "下表面") { listbm.Add("D"); } else if (strMian == "边部") { listbm.Add("E"); } else { listbm.Add(""); } //list.Add(strMian); if (strTou == "") { listbm.Add(strTou); } else { listbm.Add(strTouval); } listbm.Add(strTou); if (strCe == "") { listbm.Add(strCe); } else { listbm.Add(strCeval); } listbm.Add(strCe); if (strDaxiao == "") { listbm.Add(strDaxiao); } else { listbm.Add(strDaxiaoval); } listbm.Add(strDaxiao); if (strChengdu == "") { listbm.Add(strChengdu); } else { listbm.Add(strChengduval); } listbm.Add(strChengdu); listbm.Add(strDuoshao); listbm.Add(strMemo); if (strRepair == "") { listbm.Add("0"); } else { listbm.Add(strRepairval); } list2.Add(listbm); } } if (i > 1) { MessageBox.Show("请不要录入多条主要缺陷!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "doAddFlawL1"; ccp.ServerParams = new object[] { list2, list1 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("表面检验登记成功!"); }*/ if (ugr.Cells["SMPPICK_TP"].Text == "Y") { // smpList = new ArrayList(); //取样操作 jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 ht.Add("i" + jx, ""); jx++;//去向 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ""); jx++;//外观缺陷1 ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, ""); jx++;//外观缺陷5 ht.Add("i" + jx, ""); jx++; ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人 ht.Add("i" + jx, "取样登记"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["SMPPICK_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 ht.Add("i" + jx, ""); jx++;//去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1 ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5 ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["CRK_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向 ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1 ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5 ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_LTWG.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["EXSHAPE_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } /*if (ugr.Cells["DCS_YP"].Text == "Y")//是否更改公差 { if ((ugr.Cells["DCS_THK"].Text.ToString() != "") && (ugr.Cells["DCS_WTH"].Text.ToString() != "")) { ArrayList list1 = new ArrayList(); List list2 = new List(); List list3 = new List(); list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString()); list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add(""); list1.Add(""); string is_zl = ""; if (comboBox7.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox7.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox7.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox7.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox7.Text.ToString() == "订单外") { is_zl = "512605"; } list1.Add(""); list1.Add(this.UserInfo.GetUserName()); list1.Add(this.UserInfo.GetUserOrderText()); list1.Add(this.UserInfo.GetUserGroupText()); list1.Add(is_zl);//质量等级代码 list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称 ArrayList a3 = new ArrayList(); this.dataSet4.Clear(); string design_key = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString(); a3.Add("QCM031010_SELECT_01"); a3.Add(design_key); //string material_no = ugr.Cells["COIL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { a3 }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows) { if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "") { MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准"); return; } ArrayList listgc = new ArrayList(); listgc.Add(row["BIAS_CODE"].ToString()); listgc.Add(ugr.Cells["DCS_THK"].Text.ToString()); listgc.Add(row["BIAS_NAME"].ToString()); listgc.Add(ugr.Cells["C_ORD_THK"].Text.ToString()); listgc.Add(ugr.Cells["COIL_THK"].Text.ToString()); list2.Add(listgc); listgc = new ArrayList(); listgc.Add(row["BIAS_CODE_2"].ToString()); listgc.Add(ugr.Cells["DCS_WTH"].Text.ToString()); listgc.Add(row["BIAS_NAME_2"].ToString()); listgc.Add(ugr.Cells["C_ORD_WTH"].Text.ToString()); listgc.Add(ugr.Cells["COIL_WTH"].Text.ToString()); list2.Add(listgc); } dataSet4.Clear(); ArrayList listc1 = new ArrayList(); listc1.Add("传动侧"); listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL1"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("中间"); listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL2"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("操作侧"); listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL3"].Value.ToString()); list3.Add(listc1); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "judgeByHuman2"; ccp.ServerParams = new object[] { list1, list2, list3 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } else { MessageBox.Show("未输入公差判定值,公差判定不成功!"); return; } }*/ } } MessageBox.Show("保存成功!"); this.ultraGrid1.UpdateData(); this.DoQuery(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } //导出 public void DoExport() { try { if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid1, fName); Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } //页面初始化时加载钢卷缺陷 public void initCoilDefect() { try { //缺陷 ArrayList alt = new ArrayList(); alt.Add("UIB030110_02.SELECT"); //alt.Add("UIB030110_022.SELECT"); this.ultraCombo1Dataset.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { alt }; ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0].Merge(this.ultraCombo1Dataset.Tables[2]); //进程 alt = new ArrayList(); alt.Add("UIB030110_01.INIT_SELECT"); this.ultraCombo1Dataset.Tables[1].Clear(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { alt }; ccp.SourceDataTable = this.ultraCombo1Dataset.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["SMP_DIR_PIC_YN"].Text.Equals("Y") && ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作 { ugr.Cells["SMP_PICK_YN"].Value = this.comboBox1.SelectedItem.ToString();//执行取样操作,或者去除取样标记 ugr.Cells["SMPPICK_TP"].Value = "Y"; } } this.ultraGrid1.UpdateData(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { //取样后,重新去掉取样标记,便于下次取样操作 this.comboBox1.SelectedIndex = 0; } private void UIB020310_Load(object sender, EventArgs e) { try { this.comboBox1.SelectedIndex = 0; this.comboBox2.SelectedIndex = 0; // this.comboBox3.SelectedIndex = 0; this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked; this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked; this.textBox1.Text = OperateConditionRecode.ReadCondition("UIB030110"); //this.comboBox3.Text = OperateConditionRecode.ReadCondition("UIB030110_1"); this.comboBox3.SelectedIndex = Convert.ToInt32(OperateConditionRecode.ReadCondition("UIB030110_1")); initCoilDefect(); /*ValueList vsflv1 = new ValueList(); CoreClientParam ccp = new CoreClientParam(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "findSfLv"; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) { vsflv1.ValueListItems.Add(ccp.SourceDataTable.Rows[i]["SM_CD"].ToString(), ccp.SourceDataTable.Rows[i]["SM_CFNM"].ToString()); } this.comboBox7.DataSource = vsflv1.ValueListItems;*/ this.comboBox7.Text = "正品"; ValueList ponpse_unit = new ValueList(); ponpse_unit.ValueListItems.Add("操作类", "操作类"); ponpse_unit.ValueListItems.Add("设备类", "设备类"); ponpse_unit.ValueListItems.Add("生产计划类", "生产计划类"); ponpse_unit.ValueListItems.Add("工艺类", "工艺类"); ponpse_unit.ValueListItems.Add("其他类", "其他类"); this.ultraGrid1.DisplayLayout.Bands[0].Columns["RSEPON_UNIT"].ValueList = ponpse_unit; } catch (Exception ex) { MessageBox.Show("初始化异常"); } } private void button1_Click(object sender, EventArgs e) { try { if (comboBox3.Text.ToString() == "连退" || comboBox3.Text.ToString()=="重卷") { CUIB030110 CWindow = new CUIB030110(); CWindow.ob = this.ob; //CWindow.frmdoquery += new CUIB030110.ddd(CWindow_frmdoquery);//委托 if (CWindow.ShowDialog() == DialogResult.OK) { int arrayCount = CWindow.al.Count; //strRepair = CWindow.a2.GetByIndex(0).ToString(); //strPrimary_flag = CWindow.a2.GetByIndex(1).ToString(); //defect_desc = CWindow.a2.GetByIndex(2).ToString(); //strMian = CWindow.a2.GetByIndex(3).ToString(); //strTou = CWindow.a2.GetByIndex(4).ToString(); //strCe = CWindow.a2.GetByIndex(5).ToString(); //strDaxiao = CWindow.a2.GetByIndex(6).ToString(); //strDuoshao = CWindow.a2.GetByIndex(7).ToString(); //strChengdu = CWindow.a2.GetByIndex(8).ToString(); //strMemo = CWindow.a2.GetByIndex(9).ToString(); c = arrayCount; a = CWindow.a3; foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToLower() == "true") { //有选中项时,先进行清空。因为有初始选N个,第二次选M个。不清除,当M= 10) { this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.Red; this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.Red; } else { this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White; this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); //黄色 } } else { this.ultraGrid1.ActiveRow.Cells["COIL_WTH"].Appearance.BackColor = Color.White; this.ultraGrid1.ActiveRow.Cells["DCS_WTH"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } //判断人工录入厚度判定值与机器测量厚度实际值之差,若≥0.01则显示红色 string COILTHK = this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Text; string DCSTHK = this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Text; if (COILTHK != null && COILTHK != "" && DCSTHK != null && DCSTHK != "") { double chazhi = double.Parse(DCSTHK) - double.Parse(COILTHK); if (System.Math.Abs(chazhi) >= 0.01) { this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.Red; this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.Red; } else { this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White; this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } } else { this.ultraGrid1.ActiveRow.Cells["COIL_THK"].Appearance.BackColor = Color.White; this.ultraGrid1.ActiveRow.Cells["DCS_THK"].Appearance.BackColor = Color.FromArgb(255, 255, 128); } //换行并使其可编辑 this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow); this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate(); this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); } if(this.ultraGrid1.ActiveCell.Column.Key == "RSEPON_UNIT" || this.ultraGrid1.ActiveCell.Column.Key == "DETAINFO") { int jx; jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text.ToString()); jx++; //钢卷号 ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //责任单位 ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++; //录入人 ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["DETAINFO"].Text.ToString()); jx++; //详细信息 ht.Add("i" + jx, "1"); jx++; //缺陷5 ht.Add("i" + jx, "1"); jx++; //缺陷5 //ht.Add("i" + jx, ugr.Cells["QUEXIAN_TP"].Value.ToString()); jx++; //缺陷来源次 ht.Add("i" + jx, "卷板责任归属单位"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_RZQXLR.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); return; } MessageBox.Show("责任归属单位录入成功"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); System.Diagnostics.Debug.WriteLine(ex.ToString()); } } //private void ultraGrid1_MouseDown(object sender, MouseEventArgs e) //{ // try // { // if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询 // { // UIB010301 frm = new UIB010301(); // frm.ob = this.ob; // frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text; // frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text; // frm.ShowDialog(); // this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点 // } // else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO") // { // this.dataSet2.Tables[0].Clear(); // if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "") // { // ArrayList al = new ArrayList(); // al.Add("UIB030110_03.SELECT"); // al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text); // al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text); // 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.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点 // } // } // catch (Exception ex) // { // System.Diagnostics.Debug.WriteLine(ex.ToString()); // } //} private void textBox1_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode != Keys.Enter) return; //只对回车事件操作 this.DoQuery(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void checkBox1_Click(object sender, EventArgs e) { this.ultraDateTimeEditor1.Enabled = this.checkBox1.Checked; this.ultraDateTimeEditor2.Enabled = this.checkBox1.Checked; } private void ultraComboEditor1_SelectionChanged_1(object sender, EventArgs e) { try { object chk_ex = ultraComboEditor1.Value; if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return; string chek_exs = chk_ex.ToString(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToLower() == "true") { string sz_exp = ugr.Cells["EXTSHAPE_QUALITY_S"].Text; if (this.comboBox3.Text == "连退") { //与酸轧的外观等级进行比较是否一致,不一致则弹出提示 if (!sz_exp.Equals(chek_exs)) { if (MessageBox.Show("所选外观等级与酸轧的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK) { ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定 ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs; } } else { ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定 ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs; } } else if (this.comboBox3.Text == "重卷") { string lt_exp = ugr.Cells["EXTSHAPE_QUALITY_L"].Text; if (sz_exp.Equals(chek_exs) && lt_exp.Equals(chek_exs)) { ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定 ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs; } else { if (MessageBox.Show("所选外观等级与酸轧或连退的外观等级不一致,确定要继续吗?", "确认提示", MessageBoxButtons.OKCancel) == DialogResult.OK) { ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定 ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs; } } } else { ugr.Cells["EXSHAPE_TP"].Value = "Y";//表做了外观判定 ugr.Cells["EXTSHAPE_QUALITY"].Value = chek_exs; } } } this.ultraGrid1.UpdateData(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void ultraGrid1_Click(object sender, EventArgs e) { } //返修或降级处理 private void comboBox4_SelectedIndexChanged(object sender, EventArgs e) { try { string MES = ""; if (this.comboBox4.Text == "返修" || this.comboBox4.Text == "过渡") { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Value)) { MES += string.Format(ugr.Cells["COIL_NO"].Value.ToString()+":"); if (ugr.Cells["COIL_THK"].Value.ToString() == "0") MES += string.Format("厚度为0"); if (ugr.Cells["COIL_WTH"].Value.ToString() == "0") MES += string.Format("宽度为0"); if (ugr.Cells["WGT_DEC_RST"].Value.ToString() == "") MES += string.Format("重量未判"); if (ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() == "") MES += string.Format("外观未判"); if (ugr.Cells["COIL_THK"].Value.ToString() != "0" && ugr.Cells["COIL_WTH"].Value.ToString() != "0" && ugr.Cells["WGT_DEC_RST"].Value.ToString() != "" && ugr.Cells["EXTSHAPE_DEC_GRD"].Value.ToString() != "") MES += string.Format("可以判过渡/返修"); MES += string.Format("\r\n"); } } if (MessageBox.Show(MES, "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; } if (MessageBox.Show("确定执行该操作?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return; if ((SLSelected == "酸轧")||(SLSelected == "酸洗"))//连退才有返修操作 { if (this.comboBox4.Text == "封闭" || this.comboBox4.Text == "取消封闭" || this.comboBox4.Text == "返修" || this.comboBox4.Text == "取消返修" || this.comboBox4.Text == "过渡" || this.comboBox4.Text == "取消过渡") { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Value)) { if (this.comboBox4.Text == "封闭") { object prog_cd = ugr.Cells["CUR_PROG_CD"].Value; if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB" || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF")) { MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示"); return; } } ugr.Cells["FB_YN"].Value = this.comboBox4.Text; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", ugr.Cells["COIL_NO"].Text); ht.Add("i2", this.comboBox4.Text); ht.Add("i3", this.textBox4.Text); ht.Add("i4", this.UserInfo.GetUserName().ToString()); ht.Add("o5", ""); ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01_SUAN.CALL", ht }; CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = rccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } } return; } foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (Convert.ToBoolean(ugr.Cells["CHK"].Value)) { if (this.comboBox4.Text == "封闭") { object prog_cd = ugr.Cells["CUR_PROG_CD"].Value; if (prog_cd != null && (prog_cd.ToString() == "运送待机" || prog_cd.ToString() == "运送完成" || prog_cd.ToString() == "DFB" || prog_cd.ToString() == "DFF" || prog_cd.ToString() == "SFB" || prog_cd.ToString() == "SFF")) { MessageBox.Show("运送待机或运送完成的钢卷不能做封闭操作!", "提示"); return; } } if (this.comboBox4.Text == "" || this.comboBox4.Text == "返修") { ugr.Cells["FAN_XIU"].Value = this.comboBox4.Text; } else { ugr.Cells["RCAL_CNT"].Value = this.comboBox4.Text; } CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i1", ugr.Cells["COIL_NO"].Text); ht.Add("i2", this.comboBox4.Text); ht.Add("i3", this.textBox4.Text); ht.Add("i4", this.UserInfo.GetUserName().ToString()); ht.Add("o5", ""); ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01_LIAN.CALL", ht }; CoreClientParam rccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = rccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } this.DoQuery(); } catch (Exception ex) { MessageBox.Show("系统发生错误", "提示"); } } private void comboBox5_SelectedIndexChanged(object sender, EventArgs e) { try { //foreach (UltraGridRow ugr in this.ultraGrid1.Rows) //{ // if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作 // { // ugr.Cells["COIL_RT"].Value = this.comboBox5.SelectedItem.ToString();//执行取样操作,或者去除取样标记 // ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起 // } //} foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作 { ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记 ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起 } } this.ultraGrid1.UpdateData(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0]; if (comboBox2.SelectedItem.ToString() == "全部"){ band.ColumnFilters["FB_YN"].ClearFilterConditions(); band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions(); band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions(); band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions(); } else if (comboBox2.SelectedItem.ToString() == "封闭卷") { band.ColumnFilters["FB_YN"].ClearFilterConditions(); band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions(); band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions(); band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions(); band.ColumnFilters["FB_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y"); } else if (comboBox2.SelectedItem.ToString() == "待判卷") { band.ColumnFilters["FB_YN"].ClearFilterConditions(); band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions(); band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions(); band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions(); band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals,1); band.ColumnFilters["EXTSHAPE_DEC_GRD"].FilterConditions.Add(FilterComparisionOperator.NotEquals, 2); } else if (comboBox2.SelectedItem.ToString() == "未取样卷") { band.ColumnFilters["FB_YN"].ClearFilterConditions(); band.ColumnFilters["EXTSHAPE_DEC_GRD"].ClearFilterConditions(); band.ColumnFilters["SMP_DIR_PIC_YN"].ClearFilterConditions(); band.ColumnFilters["SMP_PICK_YN"].ClearFilterConditions(); band.ColumnFilters["SMP_DIR_PIC_YN"].FilterConditions.Add(FilterComparisionOperator.Equals, "Y"); band.ColumnFilters["SMP_PICK_YN"].FilterConditions.Add(FilterComparisionOperator.NotEquals, "Y"); } } private void comboBox6_SelectedIndexChanged(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToLower() == "true") //无取样指示则不允许进行取样操作 { ugr.Cells["CUR_PROG_CD"].Value = this.comboBox6.SelectedItem.ToString();//执行取样操作,或者去除取样标记 ugr.Cells["EXSHAPE_TP"].Value = "Y";//与外观判定的更新放在一起 } } this.ultraGrid1.UpdateData(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void button3_Click(object sender, EventArgs e) { } private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { } private void button4_Click_1(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { ArrayList list1 = new ArrayList(); List list2 = new List(); string is_pass = ""; string is_zl1 = ""; list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add("");//检验结果代码 list1.Add("");//检验结果 list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级代码 list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级名称 list1.Add(""); list1.Add(this.UserInfo.GetUserName());//操作人 list1.Add(this.UserInfo.GetUserOrderText());//班次 list1.Add(this.UserInfo.GetUserGroupText());//班组 if (ugr.Cells["MAOCI"].Text.Trim().ToString()!="") { list1.Add(ugr.Cells["MAOCI"].Text.Trim().ToString());//边部毛刺 } else { list1.Add(this.comboBox8.Text.ToString());//边部毛刺 } int count1 = 0; int i = 0; for (int c1 = 0; c1 < 5; c1++) { // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2)); if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != ""&&ugr.Cells["CRK_TP"].Text == "Y") { string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Value.ToString().Split(new char[] { ';', '【', '】' }); string strQxly = sArray[0]; string defect_desc = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1))].Text.ToString(); string strRepair = sArray[7]; string strPrimary_flag = sArray[8]; string strMian = sArray[1]; string strTou = sArray[2]; string strCe = sArray[3]; string strDaxiao = sArray[4]; string strDuoshao = sArray[5]; string strChengdu = sArray[6]; string strMemo = sArray[10]; string defect_descval = sArray[12]; string strRepairval = sArray[13]; string strPrimary_flagval = sArray[14]; string strMianval = sArray[15]; string strCeval = sArray[17]; string strTouval = sArray[16]; string strDaxiaoval = sArray[18]; string strDuoshaoval = sArray[19]; string strChengduval = sArray[20]; string strMemoval = sArray[21]; // string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString().Split(';'); // defect_desc = sArray[0]; // strRepair = sArray[1]; // strPrimary_flag = sArray[2]; // strMian = sArray[3]; // strTou = sArray[4]; // strCe = sArray[5]; // strDaxiao = sArray[6]; // strDuoshao = sArray[7]; // strChengdu = sArray[8]; // strMemo = sArray[9]; // defect_descval = sArray[10]; // strRepairval = sArray[11]; // strPrimary_flagval = sArray[12]; // strMianval = sArray[13]; // strCeval = sArray[15]; // strTouval = sArray[14]; // strDaxiaoval = sArray[16]; // strDuoshaoval = sArray[17]; // strChengduval = sArray[18]; // strMemoval = sArray[19]; // strQxly = sArray[20]; ArrayList list = new ArrayList(); if (strPrimary_flag == "") { list.Add(strPrimary_flag); } else { list.Add(strPrimary_flagval); } //int j = c1+1; if (strPrimary_flag == "1" && c1 + 1 == 1) { i++; list.Add("1"); //j = j - 1; } else if (strPrimary_flag == "1" && c1 + 1 != 1) { MessageBox.Show("请把序号为1的缺陷选为主要缺陷!"); return; } else { list.Add(Convert.ToString(c1 + 1)); } if (defect_desc == "") { list.Add(defect_desc); } else { list.Add(defect_descval); } list.Add(defect_desc); if (strMian == "上表面") { list.Add("U"); } else if (strMian == "下表面") { list.Add("D"); } else if (strMian == "边部") { list.Add("E"); } else if (strMian == "上下表面都有,且不对称") { list.Add("N"); } else if (strMian == "上下表面都有,且对称") { list.Add("S"); } else if (strMian == "钢卷侧面") { list.Add("A"); } else if (strMian == "上凸下凹") { list.Add("T"); } else if (strMian == "上凹下凸") { list.Add("B"); } else if (strMian == "已跟踪去重卷切除") { list.Add("C"); } else { list.Add(""); } //list.Add(strMian); if (strTou == "") { list.Add(strTou); } else { list.Add(strTouval); } list.Add(strTou); if (strCe == "") { list.Add(strCe); } else { list.Add(strCeval); } list.Add(strCe); if (strDaxiao == "") { list.Add(strDaxiao); } else { list.Add(strDaxiaoval); } list.Add(strDaxiao); if (strChengdu == "") { list.Add(strChengdu); } else { list.Add(strChengduval); } list.Add(strChengdu); list.Add(strDuoshao); list.Add(strMemo); if (strRepair == "") { list.Add("0"); } else { list.Add(strRepairval); } list.Add(strQxly); list2.Add(list); } } if (i > 1) { MessageBox.Show("请不要录入多条主要缺陷!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0305.QcmJudgeSurfaceServiceImpl"; ccp.MethodName = "doAddFlawL1"; ccp.ServerParams = new object[] { list2, list1 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } MessageBox.Show("表面检验登记成功!"); } if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 ht.Add("i" + jx, ""); jx++;//去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString().Substring(0, 4)); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString().Substring(0, 4)); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString().Substring(0, 4)); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; //ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString().Substring(0, 4)); jx++;//外观缺陷5 //ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserID().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["CRK_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向 ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1 ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5 ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserID().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["EXSHAPE_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } if (ugr.Cells["CHK"].Text.ToString() == "True") { string ss = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "").Replace(":", "").Replace("-", "").Replace(".", "").Replace(" ", ""); jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;// ht.Add("i" + jx, ss); jx++;// ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_WAIGUAN.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } this.ultraGrid1.UpdateData(); this.DoQuery(); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void button5_Click(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { if ((ugr.Cells["DCS_THK"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "") || (ugr.Cells["COIL_THK"].Text.ToString()!="" && ugr.Cells["COIL_WTH"].Text.ToString()!="")) { string ss = ugr.Cells["PRODNM_CD"].Text.ToString(); if (SLSelected == "酸轧"&&(ugr.Cells["PRODNM_CD"].Text.ToString() == "SD" || ugr.Cells["PRODNM_CD"].Text.ToString() == "SB")) { ArrayList list1 = new ArrayList(); List list2 = new List(); List list3 = new List(); list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString()); list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add("1"); list1.Add("合格"); string is_zl = ""; if (comboBox7.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox7.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox7.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox7.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox7.Text.ToString() == "订单外") { is_zl = "512605"; } list1.Add(""); list1.Add(this.UserInfo.GetUserName()); list1.Add(this.UserInfo.GetUserOrderText()); list1.Add(this.UserInfo.GetUserGroupText()); list1.Add(is_zl);//质量等级代码 list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称 ArrayList listc1 = new ArrayList(); listc1.Add("传动侧"); listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL1"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("中间"); listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL2"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("操作侧"); listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL3"].Value.ToString()); list3.Add(listc1); CoreClientParam ccp = new CoreClientParam(); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "judgeByHumanJ"; ccp.ServerParams = new object[] { list1, list3 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } else { ArrayList list1 = new ArrayList(); List list2 = new List(); List list3 = new List(); list1.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString()); list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add(""); list1.Add(""); string is_zl = ""; if (comboBox7.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox7.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox7.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox7.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox7.Text.ToString() == "订单外") { is_zl = "512605"; } list1.Add(""); list1.Add(this.UserInfo.GetUserName()); list1.Add(this.UserInfo.GetUserOrderText()); list1.Add(this.UserInfo.GetUserGroupText()); list1.Add(is_zl);//质量等级代码 list1.Add(comboBox7.Text.Trim().ToString());//质量等级名称 ArrayList a7 = new ArrayList(); //界面的订单规格存在问题,从后台订单表获取送去判定 this.dataSet5.Clear(); string design_key1 = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString(); //string design_key = "W502024021086001"; a7.Add("QCM031010_SELECT_02"); a7.Add(design_key1); CoreClientParam ccp5 = new CoreClientParam(); ccp5.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp5.MethodName = "doSimpleQuery"; ccp5.ServerParams = new object[] { a7 }; ccp5.SourceDataTable = this.dataSet5.Tables[0]; this.ExecuteQueryToDataTable(ccp5, CoreInvokeType.Internal); ArrayList a3 = new ArrayList(); this.dataSet4.Clear(); string design_key = ugr.Cells["ORD_NO"].Text.ToString() + ugr.Cells["ORD_SEQ"].Text.ToString(); a3.Add("QCM031010_SELECT_01"); a3.Add(design_key); //string material_no = ugr.Cells["COIL_NO"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { a3 }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); if (dataSet4.Tables[0].Rows.Count != 0) { foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows) { if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "") { MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准"); return; } ArrayList list = new ArrayList(); list.Add(row["BIAS_CODE"].ToString()); if (SLSelected == "酸轧") { list.Add(ugr.Cells["COIL_THK"].Text.ToString()); } else if (ugr.Cells["DCS_THK"].Text.ToString() != "") { list.Add(ugr.Cells["DCS_THK"].Text.ToString()); } else { list.Add(ugr.Cells["COIL_THK"].Text.ToString()); } list.Add(row["BIAS_NAME"].ToString()); //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString()); //修改订单规格为后台获取的 //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString()); foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows) { list.Add(row1["C_ORD_THK"].ToString()); } list.Add(ugr.Cells["COIL_THK"].Text.ToString()); list2.Add(list); list = new ArrayList(); list.Add(row["BIAS_CODE_2"].ToString()); if (SLSelected == "酸轧"&&ugr.Cells["DCS_WTH"].Text.ToString() != ""&&ugr.Cells["DCS_WTH"].Text.ToString() != "0") { list.Add(ugr.Cells["DCS_WTH"].Text.ToString()); } else if (SLSelected != "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "") { list.Add(ugr.Cells["DCS_WTH"].Text.ToString()); } else { list.Add(ugr.Cells["COIL_WTH"].Text.ToString()); } list.Add(row["BIAS_NAME_2"].ToString()); //list.Add(ugr.Cells["C_ORD_WTH"].Text.ToString()); //修改订单规格为后台获取的 //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString()); foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows) { list.Add(row1["C_ORD_WTH"].ToString()); } list.Add(ugr.Cells["COIL_WTH"].Text.ToString()); list2.Add(list); } } else { MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准"); return; } dataSet4.Clear(); ArrayList listc1 = new ArrayList(); listc1.Add("传动侧"); listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL1"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("中间"); listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL2"].Value.ToString()); list3.Add(listc1); listc1 = new ArrayList(); listc1.Add("操作侧"); listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL3"].Value.ToString()); list3.Add(listc1); ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "judgeByHuman2"; ccp.ServerParams = new object[] { list1, list2, list3 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } } else { MessageBox.Show("公差判定值为空,公差判定不成功!"); return; } } } //for (int i = 0; i < lists.Count; i++) //{ // lists[i].Delete(false); //} MessageBox.Show("公差检验登记成功!"); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void ultraGrid1_AfterCellUpdate(object sender, CellEventArgs e) { try { foreach (UltraGridRow ugr in ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["DCS_THK"] == e.Cell || ugr.Cells["DCS_WTH"]== e.Cell) { ugr.Cells["DCS_YP"].Value = "Y"; } } } } catch { } } private void ultraGrid1_AfterEnterEditMode(object sender, EventArgs e) { } private void ultraGrid1_MouseDown(object sender, MouseEventArgs e) { try { if (this.ultraGrid1.ActiveCell.Column.Key == "ORD_NO")//链接到品质设计结果查询 { CUIB010301 frm = new CUIB010301(); frm.ob = this.ob; frm.OrderNO = this.ultraGrid1.ActiveRow.Cells["ORD_NO"].Text; frm.OrderSEQ = this.ultraGrid1.ActiveRow.Cells["ORD_SEQ"].Text; frm.ShowDialog(); this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点 } else if (this.ultraGrid1.ActiveCell.Column.Key == "COIL_NO") { this.dataSet2.Tables[0].Clear(); if (this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text != "") { ArrayList al = new ArrayList(); al.Add("UIB030110_033.SELECT"); al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text); /*al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_NO"].Text); al.Add(this.ultraGrid1.ActiveRow.Cells["SMP_CUT_LOC"].Text);*/ this.dataSet2.Tables[0].Clear(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp.MethodName = "doSimpleQuery"; ccp.ServerParams = new object[] { al }; ccp.SourceDataTable = this.dataSet2.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } //this.ultraGrid1.ActiveRow.Cells["SPEC_ABBSYM"].Activate();//换焦点 } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void button6_Click(object sender, EventArgs e) { try { foreach (UltraGridRow ugr in ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToString() == "True") { ArrayList list1 = new ArrayList(); List list2 = new List(); string is_pass = ""; string is_zl1 = ""; ArrayList list4 = new ArrayList(); List list5 = new List(); List list6 = new List(); if ((ugr.Cells["DCS_THK"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "") || (ugr.Cells["COIL_THK"].Text.ToString() != "" && ugr.Cells["COIL_WTH"].Text.ToString() != "")) { string ss = ugr.Cells["PRODNM_CD"].Text.ToString(); if (SLSelected == "酸轧" && (ugr.Cells["PRODNM_CD"].Text.ToString() == "SD" || ugr.Cells["PRODNM_CD"].Text.ToString() == "SB")) { list4.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString()); //list4.Add("W502024021086001"); list4.Add(ugr.Cells["COIL_NO"].Value.ToString()); list4.Add("1"); list4.Add("合格"); string is_zl = ""; if (comboBox7.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox7.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox7.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox7.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox7.Text.ToString() == "订单外") { is_zl = "512605"; } list4.Add(""); list4.Add(this.UserInfo.GetUserName()); list4.Add(this.UserInfo.GetUserOrderText()); list4.Add(this.UserInfo.GetUserGroupText()); list4.Add(is_zl);//质量等级代码 list4.Add(comboBox7.Text.Trim().ToString());//质量等级名称 ArrayList listc1 = new ArrayList(); listc1.Add("传动侧"); listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL1"].Value.ToString()); list6.Add(listc1); listc1 = new ArrayList(); listc1.Add("中间"); listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL2"].Value.ToString()); list6.Add(listc1); listc1 = new ArrayList(); listc1.Add("操作侧"); listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL3"].Value.ToString()); list6.Add(listc1); } else { list4.Add(ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString()); list4.Add(ugr.Cells["COIL_NO"].Value.ToString()); list4.Add(""); list4.Add(""); string is_zl = ""; if (comboBox7.Text.ToString() == "正品") { is_zl = "512601"; } else if (comboBox7.Text.ToString() == "次品") { is_zl = "512602"; } else if (comboBox7.Text.ToString() == "废品") { is_zl = "512603"; } else if (comboBox7.Text.ToString() == "协议品") { is_zl = "512604"; } else if (comboBox7.Text.ToString() == "订单外") { is_zl = "512605"; } list4.Add(""); list4.Add(this.UserInfo.GetUserName()); list4.Add(this.UserInfo.GetUserOrderText()); list4.Add(this.UserInfo.GetUserGroupText()); list4.Add(is_zl);//质量等级代码 list4.Add(comboBox7.Text.Trim().ToString());//质量等级名称 ArrayList a7 = new ArrayList(); //界面的订单规格存在问题,从后台订单表获取送去判定 this.dataSet5.Clear(); string design_key1 = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString(); //string design_key = "W502024021086001"; a7.Add("QCM031010_SELECT_02"); a7.Add(design_key1); CoreClientParam ccp5 = new CoreClientParam(); ccp5.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp5.MethodName = "doSimpleQuery"; ccp5.ServerParams = new object[] { a7 }; ccp5.SourceDataTable = this.dataSet5.Tables[0]; this.ExecuteQueryToDataTable(ccp5, CoreInvokeType.Internal); ArrayList a3 = new ArrayList(); this.dataSet4.Clear(); string design_key = ugr.Cells["ORD_NO"].Value.ToString() + ugr.Cells["ORD_SEQ"].Value.ToString(); //string design_key = "W502024021086001"; a3.Add("QCM031010_SELECT_01"); a3.Add(design_key); CoreClientParam ccp2 = new CoreClientParam(); ccp2.ServerName = "QCM.COMMUNAL.ComDBQueryQCM"; ccp2.MethodName = "doSimpleQuery"; ccp2.ServerParams = new object[] { a3 }; ccp2.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp2, CoreInvokeType.Internal); if (dataSet4.Tables[0].Rows.Count != 0) { foreach (System.Data.DataRow row in dataSet4.Tables[0].Rows) { if (row["BIAS_CODE"].ToString() == "" || row["BIAS_CODE_2"].ToString() == "") { MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准"); return; } ArrayList list = new ArrayList(); list.Add(row["BIAS_CODE"].ToString()); if (SLSelected == "酸轧") { list.Add(ugr.Cells["COIL_THK"].Text.ToString()); } else if (ugr.Cells["DCS_THK"].Text.ToString() != "") { list.Add(ugr.Cells["DCS_THK"].Text.ToString()); } else { list.Add(ugr.Cells["COIL_THK"].Text.ToString()); } list.Add(row["BIAS_NAME"].ToString()); //修改订单规格为后台获取的 //list.Add(ugr.Cells["C_ORD_THK"].Text.ToString()); foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows) { list.Add(row1["C_ORD_THK"].ToString()); } list.Add(ugr.Cells["COIL_THK"].Text.ToString()); list5.Add(list); list = new ArrayList(); list.Add(row["BIAS_CODE_2"].ToString()); if (SLSelected == "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "" && ugr.Cells["DCS_WTH"].Text.ToString() != "0") { list.Add(ugr.Cells["DCS_WTH"].Text.ToString()); } else if (SLSelected != "酸轧" && ugr.Cells["DCS_WTH"].Text.ToString() != "") { list.Add(ugr.Cells["DCS_WTH"].Text.ToString()); } else { list.Add(ugr.Cells["COIL_WTH"].Text.ToString()); } list.Add(row["BIAS_NAME_2"].ToString()); //list.Add(ugr.Cells["C_ORD_WTH"].Text.ToString()); foreach (System.Data.DataRow row1 in dataSet5.Tables[0].Rows) { list.Add(row1["C_ORD_WTH"].ToString()); } list.Add(ugr.Cells["COIL_WTH"].Text.ToString()); list5.Add(list); } } else { MessageBox.Show(ugr.Cells["COIL_NO"].Value.ToString() + "卷没有判定标准"); return; } dataSet4.Clear(); ArrayList listc1 = new ArrayList(); listc1.Add("传动侧"); listc1.Add(ugr.Cells["THICK_VAL1"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL1"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL1"].Value.ToString()); list6.Add(listc1); listc1 = new ArrayList(); listc1.Add("中间"); listc1.Add(ugr.Cells["THICK_VAL2"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL2"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL2"].Value.ToString()); list6.Add(listc1); listc1 = new ArrayList(); listc1.Add("操作侧"); listc1.Add(ugr.Cells["THICK_VAL3"].Text.ToString()); listc1.Add(ugr.Cells["H_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["M_VAL3"].Value.ToString()); listc1.Add(ugr.Cells["R_VAL3"].Value.ToString()); list6.Add(listc1); } } list1.Add(ugr.Cells["COIL_NO"].Value.ToString()); list1.Add("");//检验结果代码 list1.Add("");//检验结果 list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级代码 list1.Add(ugr.Cells["EXTSHAPE_QUALITY"].Text.Trim().ToString());//质量等级名称 list1.Add(""); list1.Add(this.UserInfo.GetUserName());//操作人 list1.Add(this.UserInfo.GetUserOrderText());//班次 list1.Add(this.UserInfo.GetUserGroupText());//班组 if (ugr.Cells["MAOCI"].Text.Trim().ToString() != "") { list1.Add(ugr.Cells["MAOCI"].Text.Trim().ToString());//边部毛刺 } else { list1.Add(this.comboBox8.Text.ToString());//边部毛刺 } int count1 = 0; int i = 0; for (int c1 = 0; c1 < 5; c1++) { // MessageBox.Show(CWindow.al[i].ToString() +"---------"+ CWindow.al[i].ToString().Substring(2)); if (ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Text.ToString() != "") { string[] sArray = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1)) + "_TYPE"].Value.ToString().Split(new char[] { ';', '【', '】' }); string strQxly = sArray[0]; string defect_desc = ugr.Cells["CRK_CD" + Convert.ToString((c1 + 1))].Text.ToString(); string strRepair = sArray[7]; string strPrimary_flag = sArray[8]; string strMian = sArray[1]; string strTou = sArray[2]; string strCe = sArray[3]; string strDaxiao = sArray[4]; string strDuoshao = sArray[5]; string strChengdu = sArray[6]; string strMemo = sArray[10]; string defect_descval = sArray[12]; string strRepairval = sArray[13]; string strPrimary_flagval = sArray[14]; string strMianval = sArray[15]; string strCeval = sArray[17]; string strTouval = sArray[16]; string strDaxiaoval = sArray[18]; string strDuoshaoval = sArray[19]; string strChengduval = sArray[20]; string strMemoval = sArray[21]; ArrayList list = new ArrayList(); if (strPrimary_flag == "") { list.Add(strPrimary_flag); } else { list.Add(strPrimary_flagval); } //int j = c1+1; if (strPrimary_flag == "1" && c1 + 1 == 1) { i++; list.Add("1"); //j = j - 1; } else if (strPrimary_flag == "1" && c1 + 1 != 1) { MessageBox.Show("请把序号为1的缺陷选为主要缺陷!"); return; } else { list.Add(Convert.ToString(c1 + 1)); } if (defect_desc == "") { list.Add(defect_desc); } else { list.Add(defect_descval); } list.Add(defect_desc); if (strMian == "上表面") { list.Add("U"); } else if (strMian == "下表面") { list.Add("D"); } else if (strMian == "边部") { list.Add("E"); } else if (strMian == "上下表面都有,且不对称") { list.Add("N"); } else if (strMian == "上下表面都有,且对称") { list.Add("S"); } else if (strMian == "钢卷侧面") { list.Add("A"); } else if (strMian == "上凸下凹") { list.Add("T"); } else if (strMian == "上凹下凸") { list.Add("B"); } else if (strMian == "已跟踪去重卷切除") { list.Add("C"); } else { list.Add(""); } //list.Add(strMian); if (strTou == "") { list.Add(strTou); } else { list.Add(strTouval); } list.Add(strTou); if (strCe == "") { list.Add(strCe); } else { list.Add(strCeval); } list.Add(strCe); if (strDaxiao == "") { list.Add(strDaxiao); } else { list.Add(strDaxiaoval); } list.Add(strDaxiao); if (strChengdu == "") { list.Add(strChengdu); } else { list.Add(strChengduval); } list.Add(strChengdu); list.Add(strDuoshao); list.Add(strMemo); if (strRepair == "") { list.Add("0"); } else { list.Add(strRepairval); } list.Add(strQxly); list2.Add(list); } } if (i > 1) { MessageBox.Show("请不要录入多条主要缺陷!"); return; } CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0303.QcmJudgeMeasureServiceImpl"; ccp.MethodName = "judgeByHuman2LZBmgc"; ccp.ServerParams = new object[] { list2, list1,list4,list5,list6 }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == -1) { return; } } if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["CRK_TP"].Text == "Y")//外观缺陷 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 ht.Add("i" + jx, ""); jx++;//去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观缺陷录入N"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["CRK_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } if (ugr.Cells["CHK"].Text.ToString() == "True") { if (ugr.Cells["EXSHAPE_TP"].Text == "Y")//外观等级 { jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//试样号 ht.Add("i" + jx, ugr.Cells["SMP_CUT_LOC"].Text); jx++;//位置 // ht.Add("i" + jx, ugr.Cells["COIL_RT"].Text); jx++;//去向 ht.Add("i" + jx, ugr.Cells["CUR_PROG_CD"].Text); jx++;//20190228指定钢卷去向 ht.Add("i" + jx, ugr.Cells["EXTSHAPE_QUALITY"].Text); jx++;//外观等级 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入厚度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//录入宽度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//温度 ht.Add("i" + jx, ugr.Cells["SMP_NO"].Text); jx++;//粗糙度 ht.Add("i" + jx, ugr.Cells["SMP_PICK_YN"].Text); jx++;//是否取样 ht.Add("i" + jx, ugr.Cells["CRK_CD1"].Value.ToString()); jx++;//外观缺陷1 ht.Add("i" + jx, ugr.Cells["CRK_CD1_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD2_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD3_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4"].Value.ToString()); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD4_TYPE"].Text); jx++; ht.Add("i" + jx, ugr.Cells["CRK_CD5"].Value.ToString()); jx++;//外观缺陷5 ht.Add("i" + jx, ugr.Cells["CRK_CD5_TYPE"].Text); jx++; ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;//操作人 ht.Add("i" + jx, "外观等级录入"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_01.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ugr.Cells["EXSHAPE_TP"].Value = ""; ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } if (ugr.Cells["CHK"].Text.ToString() == "True") { string ss = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "").Replace(":", "").Replace("-", "").Replace(".", "").Replace(" ", ""); jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, SLSelected); jx++;//产线 ht.Add("i" + jx, ugr.Cells["COIL_NO"].Text); jx++;//钢卷号 ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++;// ht.Add("i" + jx, ss); jx++;// ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_WAIGUAN.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); } } } MessageBox.Show("表面公差检验登记成功!"); this.ultraGrid1.UpdateData(); this.DoQuery(); } catch (Exception EX) { MessageBox.Show(EX.ToString()); } } private void button6_Click_1(object sender, EventArgs e) { int jx; jx = 1; CoreClientParam ccp = new CoreClientParam(); Hashtable ht = new Hashtable(); ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["COIL_NO"].Text.ToString()); jx++; //钢卷号 ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //责任单位 ht.Add("i" + jx, this.UserInfo.GetUserName().ToString()); jx++; //录入人 ht.Add("i" + jx, this.ultraGrid1.ActiveRow.Cells["RSEPON_UNIT"].Text.ToString()); jx++; //缺陷4 ht.Add("i" + jx, "1"); jx++; //缺陷5 ht.Add("i" + jx, "1"); jx++; //缺陷5 //ht.Add("i" + jx, ugr.Cells["QUEXIAN_TP"].Value.ToString()); jx++; //缺陷来源次 ht.Add("i" + jx, "卷板责任归属单位"); jx++;//操作标志 ht.Add("o" + jx, ""); jx = 1; ccp.ServerName = "QCM.COMMUNAL.ComDBProcedureQCM"; ccp.MethodName = "doXmlProcedure"; ccp.ServerParams = new object[] { "UIB030110_RZQXLR.CALL", ht }; this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); ArrayList all = ccp.ReturnObject as ArrayList; if (all[0].ToString() != "YY")//确认是否存在问题 { MessageBox.Show(all[0].ToString(), "提示"); return; } MessageBox.Show("责任归属单位录入成功"); } private void comboBox8_SelectedValueChanged(object sender, EventArgs e) { try { object chk_ex = comboBox8.Text; if (this.ultraGrid1.ActiveRow == null || chk_ex == null) return; string chek_exs = chk_ex.ToString(); foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHK"].Text.ToLower() == "true") { ugr.Cells["MAOCI"].Value = chek_exs; this.ultraGrid1.UpdateData(); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } //private void ultraGrid1_KeyUp(object sender, KeyEventArgs e) //{ // int currentColIndex = this.ultraGrid1.ActiveCell.Column.Index; // switch (e.KeyCode) // { // case Keys.Up: // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode); // this.ultraGrid1.PerformAction(UltraGridAction.AboveRow); // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate(); // e.Handled = true; // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); // break; // case Keys.Down: // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode); // this.ultraGrid1.PerformAction(UltraGridAction.NextRow); // this.ultraGrid1.ActiveRow.Cells[currentColIndex].Activate(); // e.Handled = true; // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); // break; // case Keys.Right: // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode); // this.ultraGrid1.PerformAction(UltraGridAction.NextCell); // e.Handled = true; // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); // break; // case Keys.Left: // this.ultraGrid1.PerformAction(UltraGridAction.ExitEditMode); // this.ultraGrid1.PerformAction(UltraGridAction.PrevCell); // e.Handled = true; // this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode); // break; // } //} } }