ucNewResEaf.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Core.Mes.Client.Comm.Tool;
  5. using Core.StlMes.Client.LgClassModel;
  6. namespace Core.StlMes.Client.LgCommon.公共自定义控件.实绩管理
  7. {
  8. public partial class ucNewResEaf : ucNewResBase
  9. {
  10. public ucNewResEaf()
  11. {
  12. InitializeComponent();
  13. ClsControlPack.SetUltraGridStyle(ugData, 1);
  14. }
  15. public StlEafOptinfoEntity CurrentData = new StlEafOptinfoEntity();
  16. protected override void OnLoad(EventArgs e)
  17. {
  18. base.OnLoad(e);
  19. EntityHelper.ShowGridCaption<StlEafOptinfoEntity>(ugData.DisplayLayout.Bands[0]);
  20. SetData(new List<object> {new StlEafOptinfoEntity()});
  21. }
  22. protected override void Refresh()
  23. {
  24. QueryDate(_stove,_station);
  25. }
  26. public void QueryDate(string Stove,string Station)
  27. {
  28. _stove = Stove;
  29. _station = Station;
  30. CurrentData = GetStlEafOptinfoEntity(_stove);
  31. SetData(new List<object>
  32. {
  33. CurrentData
  34. });
  35. }
  36. public StlEafOptinfoEntity GetStlEafOptinfoEntity(string strStoveNo)
  37. {
  38. try
  39. {
  40. var list =
  41. EntityHelper.GetData<StlEafOptinfoEntity>(
  42. "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlEafOptinfoEntity",
  43. new object[] {strStoveNo}, Ob);
  44. if ((list == null) || (list.Count <= 0))
  45. return new StlEafOptinfoEntity
  46. {
  47. StoveNo = strStoveNo,
  48. Optdate = DateTime.Now
  49. };
  50. return list.FirstOrDefault();
  51. }
  52. catch (Exception ex)
  53. {
  54. return new StlEafOptinfoEntity { StoveNo = strStoveNo, Optdate = DateTime.Now };
  55. }
  56. }
  57. }
  58. }