ucNewResLfs.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Tool;
  10. using Core.StlMes.Client.LgClassModel;
  11. using Infragistics.Win;
  12. using Infragistics.Win.UltraWinGrid;
  13. namespace Core.StlMes.Client.LgCommon.公共自定义控件.实绩管理
  14. {
  15. public partial class ucNewResLfs : ucNewResBase
  16. {
  17. public ucNewResLfs()
  18. {
  19. InitializeComponent();
  20. ClsControlPack.SetUltraGridStyle(ugData, 1);
  21. }
  22. public StlLfsOptinfoEntity CurrentData = new StlLfsOptinfoEntity();
  23. protected override void OnLoad(EventArgs e)
  24. {
  25. base.OnLoad(e);
  26. EntityHelper.ShowGridCaption<StlLfsOptinfoEntity>(ugData.DisplayLayout.Bands[0]);
  27. SetData(new List<object>() { new StlLfsOptinfoEntity() });
  28. }
  29. protected override void Refresh()
  30. {
  31. QueryDate(_stove, _station);
  32. }
  33. public void QueryDate(string Stove, string Station)
  34. {
  35. _stove = Stove;
  36. _station = Station;
  37. CurrentData = GetStlLfsOptinfoEntity(_stove);
  38. SetData(new List<object>
  39. {
  40. CurrentData
  41. });
  42. }
  43. /// <summary>
  44. /// 获取StlLfsOptinfoEntity 的实体类
  45. /// </summary>
  46. /// <param name="strStoveNo">电炉号</param>
  47. /// <param name="ob"></param>
  48. /// <param name="stationcode">工序点 如LF01</param>
  49. /// <returns></returns>
  50. public StlLfsOptinfoEntity GetStlLfsOptinfoEntity(string strStoveNo)
  51. {
  52. try
  53. {
  54. var list =
  55. EntityHelper.GetData<StlLfsOptinfoEntity>(
  56. "Core.LgMes.Server.LgDeviceManager.PerformanceManage.SelectStlLfsOptinfoEntity",
  57. new object[] { strStoveNo }, Ob);
  58. if ((list == null) || (list.Count <= 0))
  59. return new StlLfsOptinfoEntity
  60. {
  61. StoveNo = strStoveNo,
  62. Optdate = DateTime.Now
  63. };
  64. return list.FirstOrDefault();
  65. }
  66. catch (Exception ex)
  67. {
  68. return new StlLfsOptinfoEntity { StoveNo = strStoveNo, Optdate = DateTime.Now };
  69. }
  70. }
  71. }
  72. }