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; namespace Core.LgMes.Client.LgJobMgt { public partial class ucHmpInInfo : UserControl { public ucHmpInInfo() { InitializeComponent(); CStaticMethod.SetUltraGridStyle(ultraGrid1, 2); //设置样式 } private void ucHmpInInfo_Load(object sender, EventArgs e) { ultraDataSource1.Rows.Add(new object[] { null, "", "" }); } 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 == "IRONSOURCE") { if (!string.IsNullOrEmpty(ar[strKey].ToString())) { // string[] Iron = ar[strKey].ToString().Split('_'); this.ultraDataSource1.Rows[0][i] = ar[strKey];//Iron[1] + "#鱼雷罐-" + Iron[0] + "#工位-" + Iron[2] + "#铁包"; } } else { if (!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] = ""; } } } else { if (this.ultraDataSource1.Band.Columns[i].DataType == typeof(System.DateTime)) this.ultraDataSource1.Rows[0][i] = null; else this.ultraDataSource1.Rows[0][i] = ""; } } catch { } } } } }