| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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 ucRhsDevInfo : UserControl
- {
- public ucRhsDevInfo()
- {
- InitializeComponent();
- CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式
- }
- public Image m_imageDefault = null;
- private void ucRhsDevInfo_Load(object sender, EventArgs e)
- {
- ultraDataSource1.Rows.Add(new object[] { "", "", "", "", "", "", "", "", "", "", m_imageDefault, "", "", "", "", "", "", "", "", "" });
- }
- public void ResetData()
- {
- try
- {
- this.ultraDataSource1.Rows[0][0] = null;
- this.ultraDataSource1.Rows[0][1] = "";
- this.ultraDataSource1.Rows[0][2] = "";
- this.ultraDataSource1.Rows[0][3] = "";
- this.ultraDataSource1.Rows[0][4] = "";
- this.ultraDataSource1.Rows[0][5] = "";
- this.ultraDataSource1.Rows[0][6] = "";
- this.ultraDataSource1.Rows[0][7] = "";
- this.ultraDataSource1.Rows[0][8] = "";
- this.ultraDataSource1.Rows[0][9] = "";
- this.ultraDataSource1.Rows[0][10] = m_imageDefault;
- this.ultraDataSource1.Rows[0][11] = "";
- this.ultraDataSource1.Rows[0][12] = "";
- this.ultraDataSource1.Rows[0][13] = "";
- this.ultraDataSource1.Rows[0][14] = "";
- this.ultraDataSource1.Rows[0][15] = "";
- this.ultraDataSource1.Rows[0][16] = "";
- this.ultraDataSource1.Rows[0][17] = "";
- this.ultraDataSource1.Rows[0][18] = "";
- this.ultraDataSource1.Rows[0][19] = "";
- this.ultraDataSource1.Rows[0][20] = "";
- this.ultraDataSource1.Rows[0][21] = "";
- }
- 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))
- 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 { }
- }
- }
- private void ultraGrid2_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
- {
- }
- }
- }
|