using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; //using Core.LgMes.Client.LgResMgt; using System.Threading; using Core.LgMes.Client.lgClassModel; using System.Collections; using System.Reflection; using CoreFS.CA06; namespace Core.LgMes.Client.lgJobMgt { public partial class frmZhiduiIron : CoreFS.CA06.FrmBase { #region defineData private Thread _getDataThread; // 取数据线程 private bool _bIfGetData = true; // 控制取数据线程循环的标志 private string[] ArrayIronRow = new string[20] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; //保存铁运进铁数据 private string[] ArrayIronRow3 = new string[25] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; //保存直兑出铁数据 private string[] ArrayIronRow4 = new string[25] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; //保存发送到转炉铁水数据 private string User ="";//操作人 private ArrayList alZDIn = new ArrayList(); //保存修改的直兑铁运进铁 private string _strSendSucceededForBof1 = ""; private string _strSendSucceededForBof2 = ""; private string _strSendSucceededForBof3 = ""; private string _strSendSucceededForHmp1 = ""; private string _strSendSucceededForHmp2 = ""; private string _strHmp1No = ""; private string _strHmp2No = ""; private bool blModify = false; #endregion #region formload public frmZhiduiIron() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; } private void frmZhiduiIron_Load(object sender, EventArgs e) { try { User = this.UserInfo.GetUserName(); lblZDJT.Text ="D" + this.Text.Substring(0, 1); lblZDCT.Text = "Z" + this.Text.Substring(0, 1); ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "", "", null }); StartUpThread(); SetUserControlDelegate(); timer1_Tick(null, new EventArgs()); this.timer1.Start(); setbutton("1"); setucInIron("1"); SetColumnModeShift(ucInIron1.ultraGrid1); SetColumnModeGroup(ucInIron1.ultraGrid1); SetColumnModequxiang(); GetInIronData(); setucHtInIron3("1"); setbutton3("1"); SetColumnModeShift(ucZDOutIron1.ultraGrid1); SetColumnModeGroup(ucZDOutIron1.ultraGrid1); SetColumnModeOutquxiang(); GetHtOutIronData(); GetElementData(); } catch { } } #endregion #region dataevent private void RefreshHighheatNo() { string sqlstr = ""; int nFurnaceNo = 0; try { if (this.rdoFNo1.Checked) nFurnaceNo = 1; if (this.rdoFNo2.Checked) nFurnaceNo = 2; if (this.rdoFNo3.Checked) nFurnaceNo = 3; if (this.rdoFNo4.Checked) nFurnaceNo = 4; if (this.rdoFNo5.Checked) nFurnaceNo = 5; if (this.rdoFNo6.Checked) nFurnaceNo = 6; if (this.rdoFNo7.Checked) nFurnaceNo = 7; if (this.rdoFNo8.Checked) nFurnaceNo = 6; if (this.rdoFNo9.Checked) nFurnaceNo = 7; if (this.radioButton1.Checked) nFurnaceNo = 0; if (nFurnaceNo > 0) { sqlstr = @" select t.*,t1.tfpotid,t1.tfpottarewgt,t1.tfpotgrosswgt,t1.tfpotwgt," + " to_char(t1.hstapholetime, 'dd HH24:mi') hstapholetime " + " from ( select substr(CHECKNO,1,INSTR(CHECKNO,'_')-1) SMELTINGID, nvl(c,0) c, si, mn, p, s, asn, ASSAYDATE,heatno " + " from job_chemelement " + " where to_char(ASSAYDATE, 'YYYYMMDDHH24MISS') BETWEEN " + " to_char((sysdate - 1 / 3), 'YYYYMMDDHH24MISS') and " + " to_char(sysdate, 'YYYYMMDDHH24MISS') " + " and Assaytypecode like '%%A%%' and substr(checkno,1,1)='" + nFurnaceNo + "'" + " order by ASSAYDATE desc ) t left join res_if_blastfurnaceiron t1 on t.heatno = t1.stoveid || '-' || " + " decode(t1.stoveid, '2', 'd', '') || t1.stovetime"; } else { sqlstr = @" select t.*,t1.tfpotid,t1.tfpottarewgt,t1.tfpotgrosswgt,t1.tfpotwgt," + " to_char(t1.hstapholetime, 'dd HH24:mi') hstapholetime " + " from (select substr(CHECKNO,1,INSTR(CHECKNO,'_')-1) SMELTINGID, nvl(c,0) c, si, mn, p, s, asn, ASSAYDATE,heatno " + " from job_chemelement " + " where to_char(ASSAYDATE, 'YYYYMMDDHH24MISS') BETWEEN " + " to_char((sysdate - 1 / 3), 'YYYYMMDDHH24MISS') and " + " to_char(sysdate, 'YYYYMMDDHH24MISS') " + " and Assaytypecode like '%%A%%' " + " order by ASSAYDATE desc ) t left join res_if_blastfurnaceiron t1 on t.heatno = t1.stoveid || '-' || " + " decode(t1.stoveid, '2', 'd', '') || t1.stovetime"; } string htOut = "", htWhere = ""; //hengxing //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classIronJob"; //par.MethodName = "GetHighHeatNo"; //par.args = new object[] { sqlstr, htWhere }; object obj = null;// ClientCommon._RemotingHelp.ExecuteMethod(par, out htOut); if (htOut == "" && obj != null) { DataTable furnaceDs = ((DataSet)obj).Tables[0]; ultraGrid1.DataSource = furnaceDs; this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Caption = "高炉号/批次"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Header.Caption = "C"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Header.Caption = "Si"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Header.Caption = "Mn"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].Header.Caption = "P"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].Header.Caption = "S"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[6].Header.Caption = "As"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[6].Width = 50; this.ultraGrid1.DisplayLayout.Bands[0].Columns[7].Header.Caption = "化验时间"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[7].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; this.ultraGrid1.DisplayLayout.Bands[0].Columns[7].Format = "dd HH:mm"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[8].Hidden = true; this.ultraGrid1.DisplayLayout.Bands[0].Columns[9].Header.Caption = "铁罐号"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[9].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[10].Header.Caption = "铁水总重"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[10].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[11].Header.Caption = "铁罐皮重"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[11].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[12].Header.Caption = "铁水净重"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[12].Width = 60; this.ultraGrid1.DisplayLayout.Bands[0].Columns[13].Header.Caption = "出铁时间"; this.ultraGrid1.DisplayLayout.Bands[0].Columns[13].Width = 60; } } catch { return; } } private void GetRealData() { if (this.Text == "") return; string Wsid = this.Text.Substring(0, 1); string strwhere = "where wsid ='" + Wsid + "'"; string err = ""; try { //hengxing //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classIronJob"; //par.MethodName = "GetRealData"; //par.args = new object[] { strwhere }; DataSet ds = null;// (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(par, out err); ultraDataSource1.Rows.Clear(); if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { ultraDataSource1.Rows.Add(new object[] { dr["IRONWGT"].ToString(), dr["GASSTRESS"].ToString(), dr["IMPORTIRONTOTAL"].ToString(), dr["EXPORTIRONTOTAL"].ToString(), dr["SKIPIRONTOTAL"].ToString(), dr["IRONTEMPERATURE"].ToString(), dr["GASFLUX"].ToString(), dr["GASCONSUME"].ToString(), dr["UPDATETIME"].ToString() }); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } } #endregion #region gridevent private void ultHtOutIronGrid_Click(object sender, EventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ultHtOutIronGrid.ActiveRow; if (aRow == null) return; ultSelectIron.Text = aRow.Cells["InIronNo"].Text; ArrayIronRow4[0] = aRow.Cells["InIronNo"].Text; ArrayIronRow4[1] = aRow.Cells["Tempture"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["Tempture"].Text : "0"; ArrayIronRow4[2] = aRow.Cells["HighLDno"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["HighLDno"].Text : "0"; ArrayIronRow4[3] = aRow.Cells["JingWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["JingWeight"].Text : "0"; ArrayIronRow4[6] = aRow.Cells["ReturnHeatNo"].Text; ArrayIronRow4[7] = aRow.Cells["ReturnWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["ReturnWeight"].Text : "0"; ArrayIronRow4[8] = aRow.Cells["LDLing"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["LDLing"].Text : "0"; } private void ultHtElementIron_AfterRowActivate(object sender, EventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ultHtElementIron.ActiveRow; if (aRow == null) return; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text != "自动") return; try { ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Value = aRow.Cells["C"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["C"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Value = aRow.Cells["SI"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["SI"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = aRow.Cells["MN"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["MN"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Value = aRow.Cells["P"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["P"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Value = aRow.Cells["S"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["S"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Value = aRow.Cells["As"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["AS"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["CHECKNO"].Value = aRow.Cells["CHECKNO"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["CHECKNO"].Text : ""; } catch { } } private void ultraGrid1_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e) { if (blModify == false) { setbutton("2"); setucInIron("2"); string shiftgroup = getshift(); Infragistics.Win.UltraWinGrid.UltraGridRow aRow = e.Row; try { SetMisnoNoEdite(); ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Value = "自动"; ucInIron1.ultraGrid1.Rows[0].Cells["InIronTime"].Value = DateTime.Now; ucInIron1.ultraGrid1.Rows[0].Cells["Group"].Value = ConvertShift("1", shiftgroup); ucInIron1.ultraGrid1.Rows[0].Cells["Shift"].Value = ConvertShift("2", shiftgroup); ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Value = e.Row.Cells["SMELTINGID"].Text.Substring(0, 1); ucInIron1.ultraGrid1.Rows[0].Cells["C"].Value = e.Row.Cells["C"].Value != System.DBNull.Value ? e.Row.Cells["C"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Value = e.Row.Cells["SI"].Value != System.DBNull.Value ? e.Row.Cells["SI"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = e.Row.Cells["MN"].Value != System.DBNull.Value ? e.Row.Cells["MN"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["P"].Value = e.Row.Cells["P"].Value != System.DBNull.Value ? e.Row.Cells["P"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["S"].Value = e.Row.Cells["S"].Value != System.DBNull.Value ? e.Row.Cells["S"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["As"].Value = e.Row.Cells["ASN"].Value != System.DBNull.Value ? e.Row.Cells["ASN"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["GuanNo"].Value = e.Row.Cells["TFPOTID"].Value != System.DBNull.Value ? e.Row.Cells["TFPOTID"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = e.Row.Cells["tfpottarewgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpottarewgt"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = e.Row.Cells["tfpotgrosswgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpotgrosswgt"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = e.Row.Cells["tfpotwgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpotwgt"].Text : ""; } catch { } } else { ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Value = e.Row.Cells["SMELTINGID"].Text.Substring(0, 1); ucInIron1.ultraGrid1.Rows[0].Cells["C"].Value = e.Row.Cells["C"].Value != System.DBNull.Value ? e.Row.Cells["C"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Value = e.Row.Cells["SI"].Value != System.DBNull.Value ? e.Row.Cells["SI"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = e.Row.Cells["MN"].Value != System.DBNull.Value ? e.Row.Cells["MN"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["P"].Value = e.Row.Cells["P"].Value != System.DBNull.Value ? e.Row.Cells["P"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["S"].Value = e.Row.Cells["S"].Value != System.DBNull.Value ? e.Row.Cells["S"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["As"].Value = e.Row.Cells["ASN"].Value != System.DBNull.Value ? e.Row.Cells["ASN"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["GuanNo"].Value = e.Row.Cells["TFPOTID"].Value != System.DBNull.Value ? e.Row.Cells["TFPOTID"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = e.Row.Cells["tfpottarewgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpottarewgt"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = e.Row.Cells["tfpotgrosswgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpotgrosswgt"].Text : ""; ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = e.Row.Cells["tfpotwgt"].Value != System.DBNull.Value ? e.Row.Cells["tfpotwgt"].Text : ""; } } /// /// 取相关数据到编辑区 铁运进铁数据 /// /// /// private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ultraGrid2.ActiveRow; if (aRow == null) return; if (ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Text == "自动") return; try { ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Value = aRow.Cells["InIronNo"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Value = aRow.Cells["HighNo"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Value = aRow.Cells["Tempture"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["Tempture"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Value = aRow.Cells["LdWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["LdWeight"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Value = aRow.Cells["MaoWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["MaoWeight"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = aRow.Cells["JingWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["JingWeight"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["GuanNo"].Value = aRow.Cells["HighLDno"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["HighLDno"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["InIronTime"].Value = aRow.Cells["InTime"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["Group"].Value = aRow.Cells["shift"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["Shift"].Value = aRow.Cells["group"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Value = aRow.Cells["QuXiang"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Value = aRow.Cells["FOLDPOTWGT"].Text; ucInIron1.ultraGrid1.Rows[0].Cells["C"].Value = aRow.Cells["C"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["C"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Value = aRow.Cells["SI"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["SI"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = aRow.Cells["MN"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["MN"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["P"].Value = aRow.Cells["P"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["P"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["S"].Value = aRow.Cells["S"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["S"].Text : "0"; ucInIron1.ultraGrid1.Rows[0].Cells["As"].Value = aRow.Cells["As"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["AS"].Text : "0"; } catch { } } private void ultHtOutIronGrid_AfterRowActivate(object sender, EventArgs e) { Infragistics.Win.UltraWinGrid.UltraGridRow aRow = ultHtOutIronGrid.ActiveRow; // Infragistics.Win.UltraWinGrid.UltraGridRow aRow = e.Row; if (aRow == null) return; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text == "自动") return; try { ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Value = aRow.Cells["InIronNo"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Value = aRow.Cells["QuXiang"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtHeatNo"].Value = aRow.Cells["IronSource"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtState"].Value = aRow.Cells["StoveNo"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Group"].Value = aRow.Cells["shift"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Shift"].Value = aRow.Cells["group"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronTime"].Value = aRow.Cells["OutTime"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronStyl"].Value = aRow.Cells["OutIronStyle"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Value = aRow.Cells["Tempture"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["Tempture"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Value = aRow.Cells["HighLDno"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["HighLDno"].Text : "0"; // ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Value = aRow.Cells["HighLDno"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["HighLDno"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Value = aRow.Cells["LdWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["LdWeight"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Value = aRow.Cells["MaoWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["MaoWeight"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = aRow.Cells["JingWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["JingWeight"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnHeatNo"].Value = aRow.Cells["ReturnHeatNo"].Text; ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Value = aRow.Cells["C"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["C"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Value = aRow.Cells["SI"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["SI"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = aRow.Cells["MN"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["MN"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Value = aRow.Cells["P"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["P"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Value = aRow.Cells["S"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["S"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Value = aRow.Cells["As"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["AS"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Value = aRow.Cells["ReturnWeight"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["ReturnWeight"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Value = aRow.Cells["LDling"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["LDling"].Text : "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["CHECKNO"].Value = aRow.Cells["CHECKNO"].Value.ToString() != System.DBNull.Value.ToString() ? aRow.Cells["CHECKNO"].Text : ""; } catch { } } #endregion #region function /// /// 发送CVT炉号 /// private void SendIronToCvt() { string strError = ""; string strWz = ""; //Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "SendZDIronToCVT", new object[] { ArrayIronRow4 }, out strError); if (strError == "") { if (ArrayIronRow4[4].Substring(0, 1) == "H") strWz = ArrayIronRow4[4].Substring(0, 2); else strWz = ArrayIronRow4[4].Substring(2, 1); switch (strWz) { case "H1": _strSendSucceededForHmp1 = "Y"; break; case "H2": _strSendSucceededForHmp2 = "Y"; break; case "1": _strSendSucceededForBof1 = "Y"; break; case "2": _strSendSucceededForBof2 = "Y"; break; case "3": _strSendSucceededForBof3 = "Y"; break; default: break; } MessageBox.Show("成功发送铁水!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else MessageBox.Show("发送失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } private void StartUpThread() { ThreadStart ts = new ThreadStart(GetDataThread); _getDataThread = new Thread(ts); _getDataThread.Name = "GetDataThread "; _getDataThread.Start(); } private void GetDataThread() { while (_bIfGetData) { if (!this.On_Off_Thread)//this.On_Off_Thread { System.Threading.Thread.Sleep(5000); continue; } try { // RefreshHighheatNo(); GetRealData(); GetCVTHeatno(); Thread.Sleep(10000); } catch { } } } /// /// 获取冶炼炉号 /// /// /// /// private void GetCVTHeatno() { try { while (true) { this.txtCVT1.Text = ""; this.txtCVT1.Appearance.BackColor = Color.LightGray; this.txtCVT2.Text = ""; this.txtCVT2.Appearance.BackColor = Color.LightGray; this.txtCVT3.Text = ""; this.txtCVT3.Appearance.BackColor = Color.LightGray; this.txtHMP1.Text = ""; this.txtHMP1.Appearance.BackColor = Color.LightGray; this.txtHMP2.Text = ""; this.txtHMP2.Appearance.BackColor = Color.LightGray; string strError = ""; DataSet ds = null;// (DataSet)Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "getCVTHMPCurrentLH", new object[] { }, out strError); if (strError == "") { if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string v_LH = ""; string v_POS = ds.Tables[0].Rows[i]["objectid"].ToString().Substring(0, 1); string v_POSID = ds.Tables[0].Rows[i]["objectpos"].ToString().Substring(3, 2); // if (ds.Tables[0].Rows[i]["objectid"].ToString().Substring(0, 1) == "V") v_LH = "V" + v_LH; if (v_POS == "C") { v_LH = (ds.Tables[0].Rows[i]["objectid"].ToString().Substring(5, 8)); if (v_POSID == "01") { if (_strSendSucceededForBof1 == "" || _strSendSucceededForBof1 == "N") HeatNo_HudwId_Exist(v_LH); if (_strSendSucceededForBof1 == "Y") txtCVT1.Appearance.BackColor = Color.LightBlue; this.txtCVT1.Text = v_LH; } if (v_POSID == "02") { if (_strSendSucceededForBof2 == "" || _strSendSucceededForBof1 == "N") HeatNo_HudwId_Exist(v_LH); if (_strSendSucceededForBof2 == "Y") txtCVT2.Appearance.BackColor = Color.LightBlue; this.txtCVT2.Text = v_LH; } if (v_POSID == "03") { if (_strSendSucceededForBof3 == "" || _strSendSucceededForBof1 == "N") HeatNo_HudwId_Exist(v_LH); if (_strSendSucceededForBof3 == "Y") txtCVT3.Appearance.BackColor = Color.LightBlue; this.txtCVT3.Text = v_LH; } } if (v_POS == "H") { v_LH = ds.Tables[0].Rows[i]["objectid"].ToString(); if (v_POSID == "01") { if (_strSendSucceededForHmp1 == "" || _strSendSucceededForHmp1 == "N") HeatNo_HudwId_Exist(v_LH); _strHmp1No = ds.Tables[0].Rows[i]["objectid"].ToString(); if (_strSendSucceededForHmp1 == "Y") txtHMP1.Appearance.BackColor = Color.LightBlue; this.txtHMP1.Text = v_LH; } if (v_POSID == "02") { if (_strSendSucceededForHmp2 == "" || _strSendSucceededForHmp2 == "N") HeatNo_HudwId_Exist(v_LH); _strHmp2No = ds.Tables[0].Rows[i]["objectid"].ToString(); if (_strSendSucceededForHmp2 == "Y") txtHMP2.Appearance.BackColor = Color.LightBlue; this.txtHMP2.Text = v_LH; } } } } if (txtCVT1.Text.Trim().Length == 0) _strSendSucceededForBof1 = "N"; if (txtCVT2.Text.Trim().Length == 0) _strSendSucceededForBof2 = "N"; if (txtCVT3.Text.Trim().Length == 0) _strSendSucceededForBof3 = "N"; if (txtHMP1.Text.Trim().Length == 0) _strSendSucceededForHmp1 = "N"; if (txtHMP2.Text.Trim().Length == 0) _strSendSucceededForHmp2 = "N"; } Thread.Sleep(5000); } } catch (Exception EE) { } } /// /// 设置铁运进铁 按钮状态 /// /// /// private void setbutton(string flag) { switch (flag) { case "1": ulbtnAdd.Enabled = true; ulbtnEdit.Enabled = true; ulbtnDelete.Enabled = true; ulbtnSave.Enabled = false; ulbtnCancel.Enabled = false; ulbtnRef.Enabled = true; ulbtnHisRequir.Enabled = true; break; case "2": ulbtnAdd.Enabled = false; ulbtnEdit.Enabled = false; ulbtnDelete.Enabled = false; ulbtnSave.Enabled = true; ulbtnCancel.Enabled = true; ulbtnRef.Enabled = true; ulbtnHisRequir.Enabled = true; break; } } /// /// 设置出铁界面BUTTON /// /// private void setbutton3(string flag) { switch (flag) { case "1": ulbtnAdd3.Enabled = true; ulbtnEdit3.Enabled = true; ulbtnDelete3.Enabled = true; ulbtnSave3.Enabled = false; ulbtnCancel3.Enabled = false; ulbtnRef3.Enabled = true; ulbtnHisRequir3.Enabled = true; break; case "2": ulbtnAdd3.Enabled = false; ulbtnEdit3.Enabled = false; ulbtnDelete3.Enabled = false; ulbtnSave3.Enabled = true; ulbtnCancel3.Enabled = true; ulbtnRef3.Enabled = true; ulbtnHisRequir3.Enabled = true; break; } } private void setucHtInIron3(string flag) { switch (flag) { case "1": ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[20].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[21].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Override.RowAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; break; case "2": ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[20].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[21].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Override.RowAppearance.BackColor = Color.LightBlue; break; } } /// /// 设置 ucInIron Grid的读写状态 /// 1:NoEDIT 2:ALLOWEDIT /// /// private void setucInIron(string flag) { switch (flag) { case "1": ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Override.RowAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; break; case "2": ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[5].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[6].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[7].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[8].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[9].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[10].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[11].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[12].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[13].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[14].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[15].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[16].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.AllowEdit; ucInIron1.ultraGrid1.DisplayLayout.Override.RowAppearance.BackColor = Color.LightBlue; break; } } private string getshift() { string err = ""; //hengxing //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classCommonModule"; //par.MethodName = "GetCurrDuty"; //par.args = new object[] { }; string ds = "";// (string)ClientCommon._RemotingHelp.ExecuteMethod(par, out err); if (ds != "") { return ds; } else { return ""; } } /// /// 序号栏锁定 /// private void SetMisnoNoEdite() { ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; } /// /// 序号栏锁定 /// private void SetMisnoNoEdite3() { ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; //ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[17].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; //ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; //ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[18].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucZDOutIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[19].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; } /// /// 班组转化 /// /// /// private string ConvertShift(string flag, string shift) { string StrReturn = ""; if (flag == "1" & shift != "") { switch (shift.Substring(0, 1)) { case "1": StrReturn = "白"; break; case "2": StrReturn = "中"; break; case "3": StrReturn = "夜"; break; } } else if (flag == "2" & shift != "") { switch (shift.Substring(1, 1)) { case "1": StrReturn = "甲"; break; case "2": StrReturn = "乙"; break; case "3": StrReturn = "丙"; break; case "4": StrReturn = "丁"; break; } } else if (flag == "3" & shift != "") { switch (shift.Trim()) { case "白": StrReturn = "1"; break; case "中": StrReturn = "2"; break; case "夜": StrReturn = "3"; break; } } else if (flag == "4" & shift != "") { switch (shift.Trim()) { case "甲": StrReturn = "1"; break; case "乙": StrReturn = "2"; break; case "丙": StrReturn = "3"; break; case "丁": StrReturn = "4"; break; } } return StrReturn; } /// /// 设置班组下拉框 /// /// private void SetColumnModeGroup(Infragistics.Win.UltraWinGrid.UltraGridBase Grid) { DataTable dt = new DataTable(); dt.TableName = "JIALIAO"; DataColumn dc = new DataColumn("BCBM", Type.GetType("System.String")); dt.Columns.Add(dc); dc = new DataColumn("BCNA", Type.GetType("System.String")); dt.Columns.Add(dc); DataRow dr = dt.NewRow(); dr["BCBM"] = "1"; dr["BCNA"] = "白"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "2"; dr["BCNA"] = "中"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "3"; dr["BCNA"] = "夜"; dt.Rows.Add(dr); //Core.LgMes.Client.LgIntegrationQuery.JJBStaticFunction.SetGridDropDownListCell("Group", 0, "班 组", 60, Grid, dt, "BCBM", "BCNA"); } /// /// 设置班组下拉框 /// /// private void SetColumnModeShift(Infragistics.Win.UltraWinGrid.UltraGridBase Grid) { DataTable dt = new DataTable(); dt.TableName = "JIALIAO"; DataColumn dc = new DataColumn("BCBM", Type.GetType("System.String")); dt.Columns.Add(dc); dc = new DataColumn("BCNA", Type.GetType("System.String")); dt.Columns.Add(dc); DataRow dr = dt.NewRow(); dr["BCBM"] = "1"; dr["BCNA"] = "甲"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "2"; dr["BCNA"] = "乙"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "3"; dr["BCNA"] = "丙"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "4"; dr["BCNA"] = "丁"; dt.Rows.Add(dr); //Core.LgMes.Client.LgIntegrationQuery.JJBStaticFunction.SetGridDropDownListCell("Shift", 0, "班组", 60, Grid, dt, "BCBM", "BCNA"); } /// /// 设置去向 /// private void SetColumnModequxiang() { DataTable dt = new DataTable(); dt.TableName = "JIALIAO"; DataColumn dc = new DataColumn("BCBM", Type.GetType("System.String")); dt.Columns.Add(dc); dc = new DataColumn("BCNA", Type.GetType("System.String")); dt.Columns.Add(dc); DataRow dr = dt.NewRow(); dr["BCBM"] = "1"; dr["BCNA"] = "1#直兑"; dt.Rows.Add(dr); //dr = dt.NewRow(); //dr["BCBM"] = "2"; //dr["BCNA"] = "2#直兑"; //dt.Rows.Add(dr); //Core.LgMes.Client.LgIntegrationQuery.JJBStaticFunction.SetGridDropDownListCell("IronQuxiang", 0, "铁水去向", 135, ucInIron1.ultraGrid1, dt, "BCBM", "BCNA"); } /// /// 设置去向 /// private void SetColumnModeOutquxiang() { DataTable dt = new DataTable(); dt.TableName = "JIALIAO"; DataColumn dc = new DataColumn("BCBM", Type.GetType("System.String")); dt.Columns.Add(dc); dc = new DataColumn("BCNA", Type.GetType("System.String")); dt.Columns.Add(dc); DataRow dr = dt.NewRow(); dr["BCBM"] = "1"; dr["BCNA"] = "1#转炉"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "2"; dr["BCNA"] = "2#转炉"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "3"; dr["BCNA"] = "3#转炉"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "4"; dr["BCNA"] = "1#预处理"; dt.Rows.Add(dr); //dr = dt.NewRow(); //dr["BCBM"] = "5"; //dr["BCNA"] = "2#预处理"; //dt.Rows.Add(dr); dr = dt.NewRow(); dr["BCBM"] = "6"; dr["BCNA"] = "1#混铁炉"; dt.Rows.Add(dr); //dr = dt.NewRow(); //dr["BCBM"] = "7"; //dr["BCNA"] = "2#混铁炉"; //dt.Rows.Add(dr); //Core.LgMes.Client.LgIntegrationQuery.JJBStaticFunction.SetGridDropDownListCellEdit("IronQuxiang", 0, "铁水去向", 100, ucZDOutIron1.ultraGrid1, dt, "BCBM", "BCNA"); } /// /// 铁运进铁设置初始数据 /// private void SetGridNewIronData() { ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Value = "自动"; ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Value = ""; ucInIron1.ultraGrid1.Rows[0].Cells["InIronTime"].Value = DateTime.Now; ucInIron1.ultraGrid1.Rows[0].Cells["Group"].Value = ConvertShift("1", getshift()); ucInIron1.ultraGrid1.Rows[0].Cells["Shift"].Value = ConvertShift("2", getshift()); ucInIron1.ultraGrid1.Rows[0].Cells["GuanNo"].Value = ""; ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["C"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["P"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["S"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["As"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Value = "0"; ucInIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Value = this.Text.Substring(0, 1); } /// /// 设置出铁初始数据 /// private void SetGridNewIronData3() { ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Value = "自动"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Value = "1#转炉"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtHeatNo"].Value = ""; ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtState"].Value = ""; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Group"].Value = ConvertShift("1", getshift()); ucZDOutIron1.ultraGrid1.Rows[0].Cells["Shift"].Value = ConvertShift("2", getshift()); ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronTime"].Value = DateTime.Now; ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronStyl"].Value = "直兑出铁"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnHeatNo"].Value = ""; ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Value = "0"; } private void Modify_Es_Comeinto() { string strError = ""; try { for (int i = 0; i < alZDIn.Count; i++) { //Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "UpdateZDHBData", new object[] { alZDIn[i] }, out strError); } alZDIn.Clear(); } catch { MessageBox.Show("直兑进铁更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } /// /// 插入出铁记录 /// /// /// private void InsertData3() { GetGridData3(); if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text == "自动") { string strError = ""; Modify_Es_Comeinto(); // Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "InsertZDOutIronData", new object[] { ArrayIronRow3 }, out strError); if (strError == "") { // MessageBox.Show("插入记录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else MessageBox.Show("插入记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string strError = ""; //Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "UpdateZDOutIronData", new object[] { ArrayIronRow3 }, out strError); if (strError != "") MessageBox.Show("修改记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 铁运进铁数据 ultraGrid2 /// private void GetInIronData() { string err = ""; string htWhere = ""; htWhere = " where to_char(ARRIVETIME,'YYYYMMDDHH24MISS') BETWEEN to_char((sysdate-1/3),'YYYYMMDDHH24MISS') and to_char(sysdate,'YYYYMMDDHH24MISS')"; try { //hengxing //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classIronJob"; //par.MethodName = "SelectZDInIronData"; //par.args = new object[] { htWhere }; //object obj = ClientCommon._RemotingHelp.ExecuteMethod(par, out err); DataSet ds = null;// (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(par, out err); ultraDataSource2.Rows.Clear(); if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { ultraDataSource2.Rows.Add(new object[] { dr["MISID"].ToString(), dr["MOLIRNSOURCE"].ToString(), dr["STOVEID"].ToString(), dr["TFPOTID"].ToString(), dr["TFPOTGROSSWGT"].ToString(), dr["TFPOTTAREWGT"].ToString(), dr["TFPOTWGT"].ToString(), dr["C"].ToString(), dr["SI"].ToString(), dr["MN"].ToString(), dr["P"].ToString(), dr["S"].ToString(), dr["ASN"].ToString(), dr["IRONTEMPERATURE"].ToString(), dr["ARRIVETIME"].ToString(), ConvertShift("1",dr["SHIFTCODE"].ToString()), ConvertShift("2",dr["SHIFTCODE"].ToString()), dr["FOLDPOTWGT"].ToString(), }); } } } catch { } } private void timer1_Tick(object sender, EventArgs e) { RefreshHighheatNo(); // GetCVTHeatno(); } /// /// 数据CHECK /// /// private bool CheckData() { if (ucInIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Value = "0"; if (ucInIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Value = "0"; if (ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = "0"; if (ucInIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["C"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["C"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["P"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["P"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["S"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["S"].Value = ""; if (ucInIron1.ultraGrid1.Rows[0].Cells["As"].Text.Trim().Length == 0) ucInIron1.ultraGrid1.Rows[0].Cells["As"].Value = ""; //if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text)) //{ // return false; //} if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["C"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["P"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["S"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["As"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text)) { return false; } if (!IsDouble(ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text)) { return false; } return true; } private static bool IsDouble(string AValue) { try { Convert.ToDouble(AValue); return true; } catch { return false; } } private void InsertData() { GetGridData(); if (ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Text == "自动") { string strError = ""; string[] strGLGH = ArrayIronRow[5].Split(','); bool blErr = false; for (int i = 0; i < strGLGH.Length; i++) { ArrayIronRow[5] = strGLGH[i]; // Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "InsertZDIronData", new object[] { ArrayIronRow }, out strError); if (strError == "") blErr = true; } if (blErr == false) MessageBox.Show("插入记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { string strError = ""; // Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "UpdateZDIronData", new object[] { ArrayIronRow }, out strError); if (strError != "") MessageBox.Show("修改记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// /// 取铁运进铁的数据 到数组 /// private void GetGridData() { try { ArrayIronRow[0] = ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Text; ArrayIronRow[1] = ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Text; ArrayIronRow[2] = ConvertShift("3", ucInIron1.ultraGrid1.Rows[0].Cells["Group"].Text) + ConvertShift("4", ucInIron1.ultraGrid1.Rows[0].Cells["shift"].Text); ArrayIronRow[3] = ucInIron1.ultraGrid1.Rows[0].Cells["InIronTime"].Text; ArrayIronRow[4] = ucInIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text; ArrayIronRow[5] = ucInIron1.ultraGrid1.Rows[0].Cells["GuanNo"].Text; ArrayIronRow[6] = ucInIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text; ArrayIronRow[7] = ucInIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text; ArrayIronRow[8] = ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text; ArrayIronRow[9] = ucInIron1.ultraGrid1.Rows[0].Cells["HighNo"].Text; ArrayIronRow[10] = ucInIron1.ultraGrid1.Rows[0].Cells["C"].Text; ArrayIronRow[11] = ucInIron1.ultraGrid1.Rows[0].Cells["Si"].Text; ArrayIronRow[12] = ucInIron1.ultraGrid1.Rows[0].Cells["Mn"].Text; ArrayIronRow[13] = ucInIron1.ultraGrid1.Rows[0].Cells["P"].Text; ArrayIronRow[14] = ucInIron1.ultraGrid1.Rows[0].Cells["S"].Text; ArrayIronRow[15] = ucInIron1.ultraGrid1.Rows[0].Cells["As"].Text; ArrayIronRow[16] = ucInIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Text; ArrayIronRow[17] = User; ArrayIronRow[18] = this.Text.Substring(0,1); ArrayIronRow[19] = ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Text; } catch { } } /// /// 取得出铁GRID数据 /// /// /// private void GetGridData3() { try { ArrayIronRow3[0] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text; ArrayIronRow3[1] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtState"].Text; //高炉炉号 ArrayIronRow3[2] = ConvertShift("3", ucZDOutIron1.ultraGrid1.Rows[0].Cells["Group"].Text) + ConvertShift("4", ucZDOutIron1.ultraGrid1.Rows[0].Cells["shift"].Text); ArrayIronRow3[3] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronTime"].Text; ArrayIronRow3[4] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text; ArrayIronRow3[5] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLDno"].Text; ArrayIronRow3[6] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text; ArrayIronRow3[7] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text; ArrayIronRow3[8] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text; ArrayIronRow3[9] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtHeatNo"].Text; //铁水来源 ArrayIronRow3[10] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Text; ArrayIronRow3[11] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Text; ArrayIronRow3[12] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Text; ArrayIronRow3[13] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Text; ArrayIronRow3[14] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Text; ArrayIronRow3[15] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Text; ArrayIronRow3[16] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Text; ArrayIronRow3[17] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnHeatNo"].Text; ArrayIronRow3[18] = User; ArrayIronRow3[19] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Text; ArrayIronRow3[20] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronStyl"].Text;//出铁类型 ArrayIronRow3[21] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Text; ArrayIronRow3[22] = this.Text.Substring(0, 1); ArrayIronRow3[23] = ucZDOutIron1.ultraGrid1.Rows[0].Cells["CHECKNO"].Text; } catch { } } /// /// 事件的委托 /// private void SetUserControlDelegate() { ucInIron1.ultraGrid1.CellChange += new Infragistics.Win.UltraWinGrid.CellEventHandler(ucInIron1_CellChange); ucZDOutIron1.ultraGrid1.CellChange += new Infragistics.Win.UltraWinGrid.CellEventHandler(ucZDOutIron1_CellChange); ucZDOutIron1.ultraGrid1.ClickCellButton += new Infragistics.Win.UltraWinGrid.CellEventHandler(ucZDOutIron1_ClickCellButton); } private void ucInIron1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { float flPZ = Convert.ToSingle(ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Text != System.DBNull.Value.ToString() ? ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Text : "0"); float flMZ = Convert.ToSingle(ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Text != System.DBNull.Value.ToString() ? ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Text : "0"); float flJZ = Convert.ToSingle(ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text != System.DBNull.Value.ToString() ? ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text : "0"); switch (e.Cell.Column.Key) { case "LdMaoWeight": { try { if (flPZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = Convert.ToString(flMZ - flPZ); else if (flJZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = Convert.ToString(flMZ - flJZ); else if (flPZ > 0 && flJZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = Convert.ToString(flMZ - flPZ); ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Value = ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value; } catch { } break; } case "LdKongWeight": { try { if (flMZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = Convert.ToString(flMZ - flPZ); else if (flJZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = Convert.ToString(flPZ + flJZ); else if (flMZ > 0 && flJZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = Convert.ToString(flMZ - flPZ); ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Value = ucInIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value; } catch { } break; } case "IronWeight": { try { if (flPZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = Convert.ToString(flJZ + flPZ); else if (flMZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Value = Convert.ToString(flMZ - flJZ); else if (flMZ > 0 && flPZ > 0) ucInIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = Convert.ToString(flJZ + flPZ); ucInIron1.ultraGrid1.Rows[0].Cells["FOLDPOTWGT"].Value = flJZ; } catch { } break; } } } private void ucZDOutIron1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { switch (e.Cell.Column.Key) { case "LdKongWeight": { try { float a = Convert.ToSingle(ucZDOutIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Text != System.DBNull.Value.ToString() ? ucZDOutIron1.ultraGrid1.Rows[0].Cells["LdKongWeight"].Text : "0"); float b = Convert.ToSingle(ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text != System.DBNull.Value.ToString() ? ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text : "0"); ucZDOutIron1.ultraGrid1.Rows[0].Cells["LdMaoWeight"].Value = Convert.ToString(b + a); } catch { } break; } case "ZhuanluLdNo": { try { string strStatus = ""; int intAge = 0; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Text.ToString().Length > 0) { intAge = GetIronwrapAge(ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Text, out strStatus); if (strStatus == "备用") ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDLing"].Value = intAge + 1; else { // MessageBox.Show("当前铁包状态【" + strStatus + "】不能使用!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDLing"].Value = ""; // ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Value = ""; } } else ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDLing"].Value = "0"; } catch { } break; } } } private void ucZDOutIron1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { switch (e.Cell.Column.Key) { case "HtHeatNo": { 弹出窗体.frmZDInIron frmMixInSource_1 = new 弹出窗体.frmZDInIron(); using (frmMixInSource_1) { if (frmMixInSource_1.ShowDialog(this) == DialogResult.OK) { ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtHeatNo"].Value = frmMixInSource_1.Laiyuan; ucZDOutIron1.ultraGrid1.Rows[0].Cells["HtState"].Value = frmMixInSource_1.stoveNo; ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = frmMixInSource_1.AllWeight; alZDIn = frmMixInSource_1.alZDInIron; string[] strIronEle = alZDIn[0] as string[]; ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Value = frmMixInSource_1.str_C; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Value = frmMixInSource_1.str_Si; ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = frmMixInSource_1.str_Mn; ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Value = frmMixInSource_1.str_P; ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Value = frmMixInSource_1.str_S; ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Value = frmMixInSource_1.str_Asn; } } break; } default: break; } } private void GetHtOutIronData() { string err = ""; string htWhere = ""; string Wsid = this.Text.Substring(0, 1); htWhere = " where to_char(TAPHOLESTARTTIME,'YYYYMMDDHH24MISS') BETWEEN to_char((sysdate-1/3),'YYYYMMDDHH24MISS') and to_char(sysdate,'YYYYMMDDHH24MISS') and WSID='" + Wsid + "'"; try { //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classIronJob"; //par.MethodName = "SelectZDOutIronData"; //par.args = new object[] { htWhere }; DataSet ds = null;// (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(par, out err); ultraDataSource4.Rows.Clear(); if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { ultraDataSource4.Rows.Add(new object[] { dr["MISID"].ToString(), dr["MOLIRNLEAVE"].ToString(), dr["IRONWRAPID"].ToString(), dr["IRONPOTTAREWGT"].ToString(), dr["IRONPOTGROSSWGT"].ToString(), dr["IRONPOTWGT"].ToString(), dr["C"].ToString(), dr["SI"].ToString(), dr["MN"].ToString(), dr["P"].ToString(), dr["S"].ToString(), dr["ASN"].ToString(), dr["IRONTEMPERATURE"].ToString(), dr["TAPHOLESTARTTIME"].ToString(), ConvertShift("1",dr["SHIFTCODE"].ToString()), ConvertShift("2",dr["SHIFTCODE"].ToString()), dr["IRONEXPORTTYPE"].ToString(), dr["SMELTINGIDOFCVT"].ToString(), dr["WEIGHTOFCVT"].ToString(), dr["IRONWRAPAGE"].ToString(), dr["MOLIRNSOURCE"].ToString(), dr["STOVEID"].ToString(), }); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } } private void GetElementData() { string err = ""; string htWhere = ""; string Wsid = this.Text.Substring(0, 1); htWhere = " and to_char(ARRIVETIME,'YYYYMMDDHH24MISS') BETWEEN to_char((sysdate-1/3),'YYYYMMDDHH24MISS') and to_char(sysdate,'YYYYMMDDHH24MISS') "; try { //hengxing //CallingMessage par = new CallingMessage(); //par.ServerName = "lgJobMgt"; //par.AssemblyName = "Core.LgMes.Server.lgJobMgt"; //par.ClassName = "Core.LgMes.Server.lgJobMgt.classIronJob"; //par.MethodName = "SelectZDElementData"; //par.args = new object[] { htWhere }; DataSet ds = null;// (DataSet)ClientCommon._RemotingHelp.ExecuteMethod(par, out err); ultraDataSource5.Rows.Clear(); if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { ultraDataSource5.Rows.Add(new object[] { dr["HEATNO"].ToString(), dr["C"].ToString(), dr["SI"].ToString(), dr["MN"].ToString(), dr["P"].ToString(), dr["S"].ToString(), dr["ASN"].ToString(), dr["NI"].ToString(), dr["CU"].ToString(), dr["SN"].ToString(), dr["SB"].ToString(), dr["CHECKNO"].ToString() }); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } } private bool CheckData3() { if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Value = "0"; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Value = "0"; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Value = "0"; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Value = ""; if (ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Text.Trim().Length == 0) ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Value = ""; if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["C"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["Si"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["Mn"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["P"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["S"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["As"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDKongWeight"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDMaoWeight"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["Temptrue"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["LDling"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["ZhuanluLdNo"].Text)) { return false; } if (!IsDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Text)) { return false; } return true; } #endregion #region buttonevent private void ulbtnAdd_Click(object sender, EventArgs e) { setbutton("2"); setucInIron("2"); SetMisnoNoEdite(); SetGridNewIronData(); } private void ulbtnEdit_Click(object sender, EventArgs e) { blModify = true; setbutton("2"); setucInIron("2"); ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit; ucInIron1.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.BackColor = System.Drawing.SystemColors.ActiveBorder; } private void ulbtnDelete_Click(object sender, EventArgs e) { if (ultraGrid2.ActiveRow == null || ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Text == "自动") return; if (MessageBox.Show(this, "您确定要删除该记录?", "提问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; string strWhere = "where MISID='" + ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Text + "'"; try { string strError = ""; // Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", "Core.LgMes.Server.lgJobMgt.classIronJob", "DeleteZDIronData", new object[] { strWhere }, out strError); if (strError == "") MessageBox.Show("删除记录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show("删除记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ee) { string s = ee.Message; } GetInIronData(); } private void ulbtnSave_Click(object sender, EventArgs e) { if (CheckData() == false) { MessageBox.Show(this, "输入的数据不完整或错误,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (ucInIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Value.ToString().Length>0 && ucInIron1.ultraGrid1.Rows[0].Cells["IronQuxiang"].Text.Substring(1, 1) != "#") { MessageBox.Show(this, "请选择铁水去向!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } InsertData(); GetInIronData(); } private void ulbtnCancel_Click(object sender, EventArgs e) { setbutton("1"); setucInIron("1"); ucInIron1.ultraGrid1.Rows[0].Cells["InIronNo"].Value = ""; ultraGrid2_AfterRowActivate(null, null); blModify = false; } private void ulbtnRef_Click(object sender, EventArgs e) { GetInIronData(); } private void ulbtnHisRequir_Click(object sender, EventArgs e) { frmRequryZDInIron frm1 = new frmRequryZDInIron(); frm1.MdiParent = this.MdiParent; // frm3.RemotingHelp = this.RemotingHelp; frm1.Show(); } private void ulbtnAdd3_Click(object sender, EventArgs e) { setbutton3("2"); setucHtInIron3("2"); SetMisnoNoEdite3(); SetGridNewIronData3(); } private void ulbtnEdit3_Click(object sender, EventArgs e) { setbutton3("2"); setucHtInIron3("2"); SetMisnoNoEdite3(); } private void ulbtnDelete3_Click(object sender, EventArgs e) { if (ultHtOutIronGrid.ActiveRow == null || ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text == "自动") return; if (MessageBox.Show(this, "您确定要删除该记录?", "提问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; string strWhere = "where MISID='" + ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Text + "'"; try { string strError = ""; //hengxing //ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", // "Core.LgMes.Server.lgJobMgt.classIronJob", // "DeleteZDOutIronData", // new object[] { strWhere,this.Text.Substring(0,1), // Convert.ToDouble(ucZDOutIron1.ultraGrid1.Rows[0].Cells["IronWeight"].Text) }, out strError); if (strError == "") MessageBox.Show("删除记录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show("删除记录失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ee) { string s = ee.Message; } GetHtOutIronData(); } private void ulbtnSave3_Click(object sender, EventArgs e) { if (CheckData3() == false) { MessageBox.Show(this, "输入的数据不完整或错误,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } InsertData3(); GetHtOutIronData(); ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnWeight"].Value = "0"; ucZDOutIron1.ultraGrid1.Rows[0].Cells["ReturnHeatNo"].Value = ""; } private void ulbtnCancel3_Click(object sender, EventArgs e) { setbutton3("1"); setucHtInIron3("1"); ucZDOutIron1.ultraGrid1.Rows[0].Cells["OutIronNo"].Value = ""; ultHtOutIronGrid_AfterRowActivate(null, null); } private void ulbtnRef3_Click(object sender, EventArgs e) { GetHtOutIronData(); GetElementData(); } private void ulbtnHisRequir3_Click(object sender, EventArgs e) { frmRequryZDoutIron frm1 = new frmRequryZDoutIron(); frm1.MdiParent = this.MdiParent; // frm3.RemotingHelp = this.RemotingHelp; frm1.Show(); } private void ulbtnCVT1_Click(object sender, EventArgs e) { if (txtCVT1.Text.Trim().Length == 0) { MessageBox.Show("1#转炉没有生产!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (ArrayIronRow4[0].Trim().Length > 0) { ArrayIronRow4[4] = txtCVT1.Text; ArrayIronRow4[5] = "CVT"; SendIronToCvt(); ArrayIronRow4[0] = ""; ArrayIronRow4[1] = ""; ArrayIronRow4[2] = ""; ArrayIronRow4[3] = ""; ArrayIronRow4[4] = ""; ArrayIronRow4[5] = ""; GetHtOutIronData(); } else MessageBox.Show("没选择要发送的铁水信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } private void ulbtnCVT2_Click(object sender, EventArgs e) { if (txtCVT2.Text.Trim().Length == 0) { MessageBox.Show("2#转炉没有生产!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (ArrayIronRow4[0].Trim().Length > 0) { ArrayIronRow4[4] = txtCVT2.Text; ArrayIronRow4[5] = "CVT"; SendIronToCvt(); ArrayIronRow4[0] = ""; ArrayIronRow4[1] = ""; ArrayIronRow4[2] = ""; ArrayIronRow4[3] = ""; ArrayIronRow4[4] = ""; ArrayIronRow4[5] = ""; GetHtOutIronData(); } else MessageBox.Show("没选择要发送的铁水信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } private void ulbtnCVT3_Click(object sender, EventArgs e) { if (txtCVT3.Text.Trim().Length == 0) { MessageBox.Show("3#转炉没有生产!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (ArrayIronRow4[0].Trim().Length > 0) { ArrayIronRow4[4] = txtCVT3.Text; ArrayIronRow4[5] = "CVT"; SendIronToCvt(); ArrayIronRow4[0] = ""; ArrayIronRow4[1] = ""; ArrayIronRow4[2] = ""; ArrayIronRow4[3] = ""; ArrayIronRow4[4] = ""; ArrayIronRow4[5] = ""; GetHtOutIronData(); } else MessageBox.Show("没选择要发送的铁水信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } private void ulbtnHMP1_Click(object sender, EventArgs e) { if (txtHMP1.Text.Trim().Length == 0) { MessageBox.Show("1#铁水预处理没有生产!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (ArrayIronRow4[0].Trim().Length > 0) { ArrayIronRow4[4] = _strHmp1No;// txtHMP1.Text; ArrayIronRow4[5] = "HMP"; SendIronToCvt(); ArrayIronRow4[0] = ""; ArrayIronRow4[1] = ""; ArrayIronRow4[2] = ""; ArrayIronRow4[3] = ""; ArrayIronRow4[4] = ""; ArrayIronRow4[5] = ""; ArrayIronRow4[8] = ""; GetHtOutIronData(); } else MessageBox.Show("没选择要发送的铁水信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } private void ulbtnHMP2_Click(object sender, EventArgs e) { if (txtHMP2.Text.Trim().Length == 0) { MessageBox.Show("2#铁水预处理没有生产!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (ArrayIronRow4[0].Trim().Length > 0) { ArrayIronRow4[4] = _strHmp2No; //txtHMP2.Text; ArrayIronRow4[5] = "HMP"; SendIronToCvt(); ArrayIronRow4[0] = ""; ArrayIronRow4[1] = ""; ArrayIronRow4[2] = ""; ArrayIronRow4[3] = ""; ArrayIronRow4[4] = ""; ArrayIronRow4[5] = ""; ArrayIronRow4[8] = ""; GetHtOutIronData(); } else MessageBox.Show("没选择要发送的铁水信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } #endregion /// /// 获取铁包包龄 /// /// /// private int GetIronwrapAge(string strIronwrapID, out string strStatus) { string strErr = ""; int intIronAge = 0; string _strStatus = ""; object obj = null;// ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", // "Core.LgMes.Server.lgJobMgt.classIronJob", // "GetIronwrapAge", new object[] { "res_es_taphole", strIronwrapID }, out strErr); if (strErr == "") { DataSet ds = (DataSet)obj; if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { intIronAge = Convert.ToInt32(ds.Tables[0].Rows[0][0]); _strStatus = ds.Tables[0].Rows[0]["STATUS"].ToString(); } } } strStatus = _strStatus; return intIronAge; } private void HeatNo_HudwId_Exist(string strID) { string strErr = ""; string strGw = ""; if (strID.Substring(0, 1) == "H") strGw = strID.Substring(0, 2); else strGw = strID.Substring(2, 1); string obj = "";// (string)ClientCommon._RemotingHelp.ExecuteMethod("lgJobMgt", // "Core.LgMes.Server.lgJobMgt.classIronJob", // "HeatNo_HudwId_Exist", new object[] { strID }, out strErr); if (strErr == "") { switch (strGw) { case "H1": _strSendSucceededForHmp1 = obj; break; case "H2": _strSendSucceededForHmp2 = obj; break; case "1": _strSendSucceededForBof1 = obj; break; case "2": _strSendSucceededForBof2 = obj; break; case "3": _strSendSucceededForBof3 = obj; break; default: break; } } } private void ultraTabControl2_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { if(e.Tab.Index==1) GetElementData(); } } }