| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- using System;
- using System.Data;
- using System.Windows.Forms;
- using System.Collections;
- using Core.Mes.Client.Common;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class UcVdPlanTime : UserControl
- {
- private Hashtable _htPlanFactTime; // 作业计划时间与实际时间
- public CoreFS.CA06.OpeBase ob = null;
- public UcVdPlanTime()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- private void UcVdsPlanTime_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 { }
- }
- }
- /// <summary>
- /// 获取作业计划时间与实际时间
- /// </summary>
- public void GetPlanAndFactTime(string _smeltingID)
- {
- string szOut = "", szWhere = "";
- if (_smeltingID == "")
- return;
- try
- {
- string strErr = "";
- ArrayList arry = new ArrayList();
- arry.Add("GetVdsPlanAndFactTime.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 { }
- }
-
- }
- }
|