LeaveRequests.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Comal.Classes;
  5. using InABox.Core;
  6. namespace PRSDesktop
  7. {
  8. public class LeaveRequests : LeaveRequestGrid, IPanel<LeaveRequest>
  9. {
  10. public bool IsReady { get; set; }
  11. public event DataModelUpdateEvent OnUpdateDataModel;
  12. public Dictionary<string, object[]> Selected()
  13. {
  14. return new Dictionary<string, object[]> { { typeof(LeaveRequest).EntityName(), SelectedRows } };
  15. }
  16. public void CreateToolbarButtons(IPanelHost host)
  17. {
  18. //
  19. }
  20. public string SectionName => "Leave Requests Grid";
  21. public DataModel DataModel(Selection selection)
  22. {
  23. var ids = ExtractValues(x => x.ID, selection).ToArray();
  24. return new LeaveRequestDataModel(new Filter<LeaveRequest>(x => x.ID).InList(ids));
  25. }
  26. public void Refresh()
  27. {
  28. Refresh(false, true);
  29. }
  30. public void Setup()
  31. {
  32. Refresh(true, false);
  33. }
  34. public void Shutdown()
  35. {
  36. }
  37. public void Heartbeat(TimeSpan time)
  38. {
  39. }
  40. public Dictionary<Type, CoreTable> DataEnvironment()
  41. {
  42. return new Dictionary<Type, CoreTable>
  43. {
  44. { typeof(LeaveRequest), Data }
  45. };
  46. }
  47. }
  48. }