| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Windows.Forms;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class ucCcmPlan : UserControl
- {
- public ucCcmPlan()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- private void ucCcmPlan_Load(object sender, EventArgs e)
- {
- ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "" });
- }
- 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 (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 if (strKey == "POTNO")
- ultraDataSource1.Rows[0][i] = ar["SENDTOOLID"].ToString();
- else if (strKey == "POTDISTINCTION")
- ultraDataSource1.Rows[0][i] = ar["SENDGRADE"].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 { }
- }
- try
- {
- ultraDataSource1.Rows[0]["AIM_W_T"] = ar["WIDTH"].ToString() + "*" + ar["THICK"].ToString();
- }
- catch { }
- }
- private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
- {
- }
- }
- }
|