using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Collections; using Core.LgMes.Client.Comm; namespace Core.LgMes.Client.LgJobMgt { public partial class ucBofTimeInfo : UserControl { public ucBofTimeInfo() { InitializeComponent(); CStaticMethod.SetUltraGridStyle(ultraGrid1, 1); //设置样式 } private void ucBofTimeInfo_Load(object sender, EventArgs e) { ultraDataSource1.Rows.Add(new object[] { null, null, null, null, "", null, null, "", null, null, "", null, null, "", null, null, "", "", "", "", "", "" }); } public void ResetData() { try { for (int i = 0; i < this.ultraDataSource1.Band.Columns.Count; i++) { if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultraDataSource1.Rows[0][i] = null; else this.ultraDataSource1.Rows[0][i] = ""; } } catch { } } public void SetData(Hashtable ar) { if (ar == null || ar.Count == 0) return; int count = this.ultraDataSource1.Band.Columns.Count; string strKey = ""; for (int i = 0; i < count; i++) { try { strKey = this.ultraDataSource1.Band.Columns[i].Key; if (ar.Contains(strKey)) if(!string.IsNullOrEmpty(ar[strKey].ToString())) this.ultraDataSource1.Rows[0][i] = ar[strKey]; else if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultraDataSource1.Rows[0][i] = null; else this.ultraDataSource1.Rows[0][i] = ""; else { if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultraDataSource1.Rows[0][i] = null; else this.ultraDataSource1.Rows[0][i] = ""; } } catch { } } try { //兑铁时间 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CHANGESTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CHANGEENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["DTSJ"] =CStaticMethod.caculateSecondsTime( CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CHANGESTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CHANGEENDTIME"])).ToString()); else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CHANGESTARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["CHANGEENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["DTSJ"] =CStaticMethod.caculateSecondsTime( CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["CHANGESTARTTIME"]), DateTime.Now).ToString()); //一次吹炼 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B1STARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B1ENDTIME"].ToString())) { if(!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B1TIME"].ToString())) this.ultraDataSource1.Rows[0]["B1TIME"] =CStaticMethod.caculateSecondsTime(ar["B1TIME"].ToString()); else this.ultraDataSource1.Rows[0]["B1TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B1STARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B1ENDTIME"])).ToString()); } else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B1STARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B1ENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["B1TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B1STARTTIME"]), DateTime.Now).ToString()); //二次吹炼 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B2STARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B2ENDTIME"].ToString())) { if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B2TIME"].ToString())) this.ultraDataSource1.Rows[0]["B2TIME"] = CStaticMethod.caculateSecondsTime(ar["B2TIME"].ToString()); else this.ultraDataSource1.Rows[0]["B2TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B2STARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B2ENDTIME"])).ToString()); } else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B2STARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B2ENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["B2TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B2STARTTIME"]), DateTime.Now).ToString()); //三次吹炼 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B3STARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B3ENDTIME"].ToString())) { if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B3TIME"].ToString())) this.ultraDataSource1.Rows[0]["B3TIME"] = CStaticMethod.caculateSecondsTime(ar["B3TIME"].ToString()); else this.ultraDataSource1.Rows[0]["B3TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B3STARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B3ENDTIME"])).ToString()); } else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B3STARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B3ENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["B3TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B3STARTTIME"]), DateTime.Now).ToString()); //四次吹炼 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B4STARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B4ENDTIME"].ToString())) { if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B4TIME"].ToString())) this.ultraDataSource1.Rows[0]["B4TIME"] = CStaticMethod.caculateSecondsTime(ar["B4TIME"].ToString()); else this.ultraDataSource1.Rows[0]["B4TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B4STARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B4ENDTIME"])).ToString()); } else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B4STARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B4ENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["B4TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B4STARTTIME"]), DateTime.Now).ToString()); //五次吹炼 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B5STARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B5ENDTIME"].ToString())) { if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B5TIME"].ToString())) this.ultraDataSource1.Rows[0]["B5TIME"] = CStaticMethod.caculateSecondsTime(ar["B5TIME"].ToString()); else this.ultraDataSource1.Rows[0]["B5TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B5STARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B5ENDTIME"])).ToString()); } else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B5STARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["B5ENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["B5TIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["B5STARTTIME"]), DateTime.Now).ToString()); //出钢时间 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["TAPPINGSTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["TAPPINGENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["TAPPINGTIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["TAPPINGSTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["TAPPINGENDTIME"])).ToString()); else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["TAPPINGSTARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["TAPPINGENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["TAPPINGTIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["TAPPINGSTARTTIME"]), DateTime.Now).ToString()); //溅渣护炉 if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["PSSTARTTIME"].ToString()) && !string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["PSENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["BRPSTIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["PSSTARTTIME"]), Convert.ToDateTime(this.ultraDataSource1.Rows[0]["PSENDTIME"])).ToString()); else if (!string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["PSSTARTTIME"].ToString()) && string.IsNullOrEmpty(this.ultraDataSource1.Rows[0]["PSENDTIME"].ToString())) this.ultraDataSource1.Rows[0]["BRPSTIME"] = CStaticMethod.caculateSecondsTime(CStaticMethod.caculateTimeSeconds(Convert.ToDateTime(this.ultraDataSource1.Rows[0]["PSSTARTTIME"]), DateTime.Now).ToString()); } catch { } } } }