| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- 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;
- using CoreFS.CA06;
- using Core.Mes.Client.Common;
- namespace Core.LgMes.Client.LgResMgt
- {
- public partial class ucPlan : UserControl
- {
- public Hashtable _htPlanInfo; // 用于作业计划信息的表字段数据
- public OpeBase ob = null;
- public ucPlan()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- private void ucPlan_Load(object sender, EventArgs e)
- {
- ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "" });
- _htPlanInfo = new Hashtable();
- }
- /// <summary>
- /// 初始计划信息
- /// </summary>
- 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 { }
- }
- /// <summary>
- /// 获取计划信息
- /// </summary>
- public void GetPlanInfo(string _smeltingID)
- {
- string strErr = "", szWhere = "";
- if (_smeltingID == "")
- return;
- try
- {
- ArrayList arry = new ArrayList();
- arry.Add("GetPlanInfo.select");
- arry.Add(_smeltingID);
- arry.Add(_smeltingID);
- arry.Add(_smeltingID);
- CommonClientToServer cctos = new CommonClientToServer();
- cctos.ob = ob;
- DataSet ds = cctos.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery",
- "doSimpleQuery", arry, out strErr);
- if (strErr == "" && ds != null)
- {
-
- if (ds.Tables[0].Rows.Count > 0)
- {
- for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
- {
- if (_htPlanInfo.Contains(ds.Tables[0].Columns[i].ColumnName))
- _htPlanInfo.Remove(ds.Tables[0].Columns[i].ColumnName);
- _htPlanInfo.Add(ds.Tables[0].Columns[i].ColumnName, ds.Tables[0].Rows[0][i].ToString());
- }
- SetData(_htPlanInfo); //显示计划
- }
- else
- _htPlanInfo.Clear();
-
- }
- }
- catch { }
- }
- /// <summary>
- /// 显示计划信息
- /// </summary>
- /// <param name="ar"></param>
- 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 (strKey == "SHIFTCODE") // 班次转换
- ultraDataSource1.Rows[0][i] = CStaticMethod.ClassConvert(ar[strKey].ToString());
- else if (strKey == "FACT_ROUTE")
- ultraDataSource1.Rows[0][i] = CStaticMethod.analysPath(ar[strKey].ToString());
- else
- 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] = "";
- }
- }
- catch { }
- }
- }
- }
- }
|