ucNewResEafWeight.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 ucNewResEafWeight : ucNewResBase
  9. {
  10. public ucNewResEafWeight()
  11. {
  12. InitializeComponent();
  13. ClsControlPack.SetUltraGridStyle(ugData, 1);
  14. }
  15. protected override void OnLoad(EventArgs e)
  16. {
  17. base.OnLoad(e);
  18. EntityHelper.ShowGridCaption<StlEafOptinfoEntity>(ugData.DisplayLayout.Bands[0]);
  19. SetData(new List<object> {new StlEafOptinfoEntity()});
  20. }
  21. protected override void Refresh()
  22. {
  23. QueryDate(_stove,_station);
  24. }
  25. public void QueryDate(string Stove,string Station)
  26. {
  27. _stove = Stove;
  28. _station = Station;
  29. SetData(new List<object>
  30. {
  31. GetStlEafOptinfoEntity(_stove)
  32. });
  33. }
  34. public StlEafOptinfoEntity GetStlEafOptinfoEntity(string strStoveNo)
  35. {
  36. try
  37. {
  38. var list =
  39. EntityHelper.GetData<StlEafOptinfoEntity>(
  40. "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlEafOptinfoEntity",
  41. new object[] {strStoveNo}, Ob);
  42. if ((list == null) || (list.Count <= 0))
  43. return new StlEafOptinfoEntity
  44. {
  45. StoveNo = strStoveNo
  46. };
  47. return list.FirstOrDefault();
  48. }
  49. catch (Exception ex)
  50. {
  51. return new StlEafOptinfoEntity {StoveNo = strStoveNo};
  52. }
  53. }
  54. }
  55. }