| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- using System.Collections;
- using Core.LgMes.Client.Comm;
- namespace Core.LgMes.Client.LgJobMgt
- {
- public partial class ucHmpDevInfo : UserControl
- {
- public Image m_imageDefault = null;
- public ucHmpDevInfo()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- private void ucHmpDevInfo_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 if(this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.Drawing.Bitmap))
- ultraDataSource1.Rows[0]["TP"] = m_imageDefault;
- 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) && !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] = "";
- }
- }
- catch { }
- }
- }
- }
- }
|