LeaveRequests.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 bool Focus()
  27. {
  28. return true;
  29. }
  30. public void Refresh()
  31. {
  32. Refresh(false, true);
  33. }
  34. public void Setup()
  35. {
  36. Refresh(true, false);
  37. }
  38. public void Shutdown()
  39. {
  40. }
  41. public void Heartbeat(TimeSpan time)
  42. {
  43. }
  44. public Dictionary<Type, CoreTable> DataEnvironment()
  45. {
  46. return new Dictionary<Type, CoreTable>
  47. {
  48. { typeof(LeaveRequest), Data }
  49. };
  50. }
  51. }
  52. }