using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.LgClassModel; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; namespace Core.StlMes.Client.LgCommon.公共自定义控件.实绩管理 { public partial class ucNewResCcm : ucNewResBase { public ucNewResCcm() { InitializeComponent(); ClsControlPack.SetUltraGridStyle(ugData, 1); } public StlCcmOptinfoEntity CurrentData = new StlCcmOptinfoEntity(); protected override void OnLoad(EventArgs e) { base.OnLoad(e); EntityHelper.ShowGridCaption(ugData.DisplayLayout.Bands[0]); SetData(new List() { new StlCcmOptinfoEntity() }); foreach (UltraGridColumn ugc in ugData.DisplayLayout.Bands[0].Columns) { ugc.CellActivation = Activation.AllowEdit; } } protected override void Refresh() { QueryDate(_stove, _station); } public void QueryDate(string Stove, string Station) { _stove = Stove; _station = Station; CurrentData = GetStlCcmOptinfoEntity(_stove); SetData(new List { CurrentData }); } public StlCcmOptinfoEntity GetStlCcmOptinfoEntity(string strStoveNo) { try { var list = EntityHelper.GetData( "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlCcmOptinfoEntity", new object[] { strStoveNo }, Ob); if (list == null || list.Count <= 0) { return new StlCcmOptinfoEntity() { StoveNo = strStoveNo }; } return list.FirstOrDefault(); } catch (Exception ex) { return new StlCcmOptinfoEntity() { StoveNo = strStoveNo }; } } } }