ucNewResCcm.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Drawing;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Core.Mes.Client.Comm.Tool;
  11. using Core.StlMes.Client.LgClassModel;
  12. using Infragistics.Win;
  13. using Infragistics.Win.UltraWinGrid;
  14. namespace Core.StlMes.Client.LgCommon.公共自定义控件.实绩管理
  15. {
  16. public partial class ucNewResCcm : ucNewResBase
  17. {
  18. public ucNewResCcm()
  19. {
  20. InitializeComponent();
  21. ClsControlPack.SetUltraGridStyle(ugData, 1);
  22. }
  23. public StlCcmOptinfoEntity CurrentData = new StlCcmOptinfoEntity();
  24. protected override void OnLoad(EventArgs e)
  25. {
  26. base.OnLoad(e);
  27. EntityHelper.ShowGridCaption<StlCcmOptinfoEntity>(ugData.DisplayLayout.Bands[0]);
  28. SetData(new List<object>() { new StlCcmOptinfoEntity() });
  29. foreach (UltraGridColumn ugc in ugData.DisplayLayout.Bands[0].Columns)
  30. {
  31. ugc.CellActivation = Activation.AllowEdit;
  32. }
  33. }
  34. protected override void Refresh()
  35. {
  36. QueryDate(_stove, _station);
  37. }
  38. public void QueryDate(string Stove, string Station)
  39. {
  40. _stove = Stove;
  41. _station = Station;
  42. CurrentData = GetStlCcmOptinfoEntity(_stove);
  43. SetData(new List<object>
  44. {
  45. CurrentData
  46. });
  47. }
  48. public StlCcmOptinfoEntity GetStlCcmOptinfoEntity(string strStoveNo)
  49. {
  50. try
  51. {
  52. var list =
  53. EntityHelper.GetData<StlCcmOptinfoEntity>(
  54. "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlCcmOptinfoEntity",
  55. new object[] { strStoveNo }, Ob);
  56. if (list == null || list.Count <= 0)
  57. {
  58. return new StlCcmOptinfoEntity() { StoveNo = strStoveNo };
  59. }
  60. return list.FirstOrDefault();
  61. }
  62. catch (Exception ex)
  63. {
  64. return new StlCcmOptinfoEntity() { StoveNo = strStoveNo };
  65. }
  66. }
  67. }
  68. }