ServicePanel.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Configuration;
  4. using InABox.Core;
  5. using InABox.DynamicGrid;
  6. using InABox.Wpf;
  7. namespace PRSDesktop;
  8. public class ServicePanelSettings : BaseObject, IUserConfigurationSettings, IMasterDetailSettings
  9. {
  10. [NullEditor] public DynamicSplitPanelView ViewType { get; set; } = DynamicSplitPanelView.Combined;
  11. [NullEditor]
  12. public double AnchorWidth { get; set; } = 300;
  13. [NullEditor]
  14. public Guid MasterID { get; set; }
  15. }
  16. public class ServicePanel : MasterDetailPanel<Job,ServiceGrid,ServicePanelSettings>
  17. {
  18. protected override string MasterCaption => "Service Jobs";
  19. protected override string DetailCaption => "Job Details";
  20. protected override string MasterColumnsTag => "Service";
  21. protected override void CreatePages()
  22. {
  23. CreatePage<JobDetailPanel<JobDetails>>("Details");
  24. CreatePage<JobDetailGrid<JobOrderGrid, ConsolidatedPurchaseOrderItem>>(Security.CanView<PurchaseOrderItem>, "Orders");
  25. CreatePage<JobDetailPanel<JobPickingListPanel>>(Security.CanView<Requisition>, "Picking Lists");
  26. CreatePage<JobDetailGrid<JobAssignmentGrid, Assignment>>(Security.CanView<Assignment>, "Assignments");
  27. CreatePage<JobDetailGrid<JobFormGrid, JobForm>>(Security.CanView<JobForm>, "Forms");
  28. CreatePage<JobDetailPanel<InvoicePanel>>(Security.CanView<Invoice>, "Invoices");
  29. }
  30. protected override void AfterLoadSettings(ServicePanelSettings settings)
  31. {
  32. }
  33. protected override void BeforeSaveSettings(ServicePanelSettings settings)
  34. {
  35. }
  36. public override void CreateToolbarButtons(IPanelHost host)
  37. {
  38. ProjectSetupActions.JobStatuses(host);
  39. // host.CreateSetupAction(new PanelAction()
  40. // {
  41. // Caption = "Job Settings",
  42. // Image = PRSDesktop.Resources.specifications,
  43. // OnExecute = action =>
  44. // {
  45. // if (DynamicGridUtils.Edit(Settings))
  46. // SaveSettings();
  47. // }
  48. // });
  49. }
  50. }