QuotePanel.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 QuotePanelSettings : 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 QuotePanel : MasterDetailPanel<Quote,QuoteGrid,QuotePanelSettings>
  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<QuoteDetailPanel<QuoteDetails>>("Details");
  24. CreatePage<QuoteDetailGrid<QuoteDocuments, QuoteDocument>>(Security.CanView<QuoteDocument>, "Documents");
  25. CreatePage<QuoteDetailGrid<QuoteSpreadsheets, QuoteSpreadsheet>>(Security.CanView<QuoteSpreadsheet>, "Spreadsheets");
  26. CreatePage<QuoteDetailPanel<QuoteDiagrams>>(Security.CanView<QuoteDiagram>, "Diagrams");
  27. CreatePage<QuoteDetailGrid<QuoteTakeoffs, QuoteTakeoff>>(Security.CanView<QuoteTakeoff>, "Takeoffs");
  28. CreatePage<QuoteDetailPanel<QuoteDesigns>>(Security.CanView<QuoteDesign>, "Designs");
  29. CreatePage<QuoteDetailPanel<QuoteCostSheets>>(Security.CanView<QuoteCostSheet>, "Cost Sheets");
  30. CreatePage<QuoteDetailPanel<QuoteProposals>>(Security.CanView<QuoteProposal>, "Proposals");
  31. CreatePage<QuoteDetailPanel<QuoteContracts>>(Security.CanView<QuoteContract>, "Contracts");
  32. }
  33. protected override void AfterLoadSettings(QuotePanelSettings settings)
  34. {
  35. }
  36. protected override void BeforeSaveSettings(QuotePanelSettings settings)
  37. {
  38. }
  39. public override void CreateToolbarButtons(IPanelHost host)
  40. {
  41. QuoteSetupActions.Standard(host);
  42. // host.CreateSetupAction(new PanelAction()
  43. // {
  44. // Caption = "Job Settings",
  45. // Image = PRSDesktop.Resources.specifications,
  46. // OnExecute = action =>
  47. // {
  48. // if (DynamicGridUtils.Edit(Settings))
  49. // SaveSettings();
  50. // }
  51. // });
  52. }
  53. }