| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.LgClassModel;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.LgCommon.公共自定义控件.实绩管理
- {
- public partial class ucNewResCcmCast : ucNewResBase
- {
- private string _castNo;
- private StlCcmMouldinfoEntity _data;
- public ucNewResCcmCast()
- {
- InitializeComponent();
- ClsControlPack.SetUltraGridStyle(ugData, 1);
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- EntityHelper.ShowGridCaption<StlCcmMouldinfoEntity>(ugData.DisplayLayout.Bands[0]);
- SetData(new List<object> {new StlCcmMouldinfoEntity()});
- foreach (var ugc in ugData.DisplayLayout.Bands[0].Columns)
- ugc.CellActivation = Activation.AllowEdit;
- }
- protected override void Refresh()
- {
- QueryDate(_castNo);
- }
- public void QueryDate(string castNo)
- {
- _castNo = castNo;
- _data = GetStlCcmMouldinfoEntity(_castNo);
- SetData(new List<object>
- {
- _data
- });
- }
- public StlCcmMouldinfoEntity GetStlCcmMouldinfoEntity(string castNo)
- {
- try
- {
- var list =
- EntityHelper.GetData<StlCcmMouldinfoEntity>(
- "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlCcmMouldinfoEntity",
- new object[] {castNo}, Ob);
- if ((list == null) || (list.Count <= 0))
- return new StlCcmMouldinfoEntity {Mouldno = castNo};
- return list.FirstOrDefault();
- }
- catch (Exception)
- {
- return new StlCcmMouldinfoEntity {Mouldno = castNo};
- }
- }
- public bool SaveStlCcmMouldinfoEntity()
- {
- try
- {
- if (!HasChanged || _data == null ) return true;
- ServerHelper.SetData("Core.LgMes.Server.LgDeviceManager.PerformanceManage.SaveStlCcmMouldinfoEntity",
- new object[] { _data, _castNo }, Ob);
- Refresh();
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- }
- }
- }
|