JobAssignmentPanel.xaml.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 ParentID
  17. { get => Activities.JobID;
  18. set
  19. {
  20. Activities.JobID = value;
  21. Assignments.JobID = value;
  22. }
  23. }
  24. public JobPanelSettings Settings { get; set; }
  25. #endregion
  26. #region IDataModelSource
  27. public event DataModelUpdateEvent OnUpdateDataModel;
  28. public string SectionName => "Job Assignments";
  29. public DataModel DataModel(Selection selection)
  30. {
  31. var ids = Assignments.ExtractValues(x => x.ID, selection).ToArray();
  32. return new AssignmentDataModel(new Filter<Assignment>(x => x.ID).InList(ids));
  33. }
  34. #endregion
  35. #region IBasePanel
  36. public void Setup()
  37. {
  38. Activities.Refresh(true, false);
  39. Assignments.Refresh(true, false);
  40. }
  41. public void Shutdown()
  42. {
  43. }
  44. public void Refresh()
  45. {
  46. Activities.Refresh(false, true);
  47. Assignments.Refresh(false, true);
  48. }
  49. public bool IsReady { get; set; }
  50. public void CreateToolbarButtons(IPanelHost host)
  51. {
  52. }
  53. public Dictionary<string, object[]> Selected()
  54. {
  55. return new Dictionary<string, object[]>();
  56. }
  57. public void Heartbeat(TimeSpan time)
  58. {
  59. }
  60. #endregion
  61. }
  62. }