JobAssignmentPanel.xaml.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Controls;
  5. using Comal.Classes;
  6. using InABox.Core;
  7. namespace PRSDesktop
  8. {
  9. public partial class JobAssignmentPanel : UserControl, IBasePanel, IJobControl, IDataModelSource
  10. {
  11. public JobAssignmentPanel()
  12. {
  13. InitializeComponent();
  14. }
  15. #region IJobPanel
  16. public Guid JobID
  17. { get => Activities.JobID;
  18. set
  19. {
  20. Activities.JobID = value;
  21. Assignments.JobID = value;
  22. }
  23. }
  24. #endregion
  25. #region IDataModelSource
  26. public event DataModelUpdateEvent OnUpdateDataModel;
  27. public string SectionName => "Job Assignments";
  28. public DataModel DataModel(Selection selection)
  29. {
  30. var ids = Assignments.ExtractValues(x => x.ID, selection).ToArray();
  31. return new AssignmentDataModel(new Filter<Assignment>(x => x.ID).InList(ids));
  32. }
  33. #endregion
  34. #region IBasePanel
  35. public void Setup()
  36. {
  37. Activities.Refresh(true, false);
  38. Assignments.Refresh(true, false);
  39. }
  40. public void Shutdown()
  41. {
  42. }
  43. public void Refresh()
  44. {
  45. Activities.Refresh(false, true);
  46. Assignments.Refresh(false, true);
  47. }
  48. public bool IsReady { get; set; }
  49. public void CreateToolbarButtons(IPanelHost host)
  50. {
  51. }
  52. public Dictionary<string, object[]> Selected()
  53. {
  54. return new Dictionary<string, object[]>();
  55. }
  56. public void Heartbeat(TimeSpan time)
  57. {
  58. }
  59. #endregion
  60. }
  61. }