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 CoreFS.CA06; using Core.Mes.Client.Common; namespace Core.LgMes.Client.LgJobMgt { public partial class UcCcmPlanTime : UserControl { private Hashtable _htPlanFactTime; // 作业计划时间与实际时间 public CoreFS.CA06.OpeBase ob = null; public UcCcmPlanTime() { InitializeComponent(); CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式 } private void UcCcmPlanTime_Load(object sender, EventArgs e) { ultdsPlanTime.Rows.Add(new object[] { null }); _htPlanFactTime = new Hashtable(); } public void ResetData() { try { for (int i = 0; i < this.ultdsPlanTime.Band.Columns.Count; i++) { if (this.ultdsPlanTime.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultdsPlanTime.Rows[0][i] = null; else this.ultdsPlanTime.Rows[0][i] = ""; } } catch { } } public void SetData() { if (_htPlanFactTime == null || _htPlanFactTime.Count == 0) return; int count = this.ultdsPlanTime.Band.Columns.Count; string strKey = ""; for (int i = 0; i < count; i++) { try { strKey = this.ultdsPlanTime.Band.Columns[i].Key; if (_htPlanFactTime.Contains(strKey)) if (!string.IsNullOrEmpty(_htPlanFactTime[strKey].ToString())) this.ultdsPlanTime.Rows[0][i] = _htPlanFactTime[strKey]; else if (this.ultdsPlanTime.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultdsPlanTime.Rows[0][i] = null; else this.ultdsPlanTime.Rows[0][i] = ""; else { if (this.ultdsPlanTime.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultdsPlanTime.Rows[0][i] = null; else this.ultdsPlanTime.Rows[0][i] = ""; } } catch { } } } /// /// 获取作业计划时间与实际时间 /// public void GetPlanAndFactTime(string _smeltingID) { string szOut = "", szWhere = ""; if (_smeltingID == "") return; try { string strErr = ""; ArrayList arry = new ArrayList(); arry.Add("GetCcmPlanAndFactTime.Select");//此ID为XML文件ID arry.Add(_smeltingID); CommonClientToServer ccs = new CommonClientToServer(); ccs.ob = ob; //查询转炉作业采样信息 DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.LgJobMgt.ClassBofJob", "GetPlanAndFactTime", arry, out strErr); if (strErr == "" && ds != null) { DataTable tb = ds.Tables[0]; if (tb.Rows.Count > 0) { for (int i = 0; i < tb.Columns.Count; i++) { if (_htPlanFactTime.Contains(tb.Columns[i].ColumnName)) _htPlanFactTime.Remove(tb.Columns[i].ColumnName); _htPlanFactTime.Add(tb.Columns[i].ColumnName, tb.Rows[0][i].ToString()); } } } } catch { } } } }