LeaveRequests.cs 1.6 KB

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