QuotePanel.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 string SectionName => "Quotes";
  40. public override void CreateToolbarButtons(IPanelHost host)
  41. {
  42. QuoteSetupActions.Standard(host);
  43. // host.CreateSetupAction(new PanelAction()
  44. // {
  45. // Caption = "Job Settings",
  46. // Image = PRSDesktop.Resources.specifications,
  47. // OnExecute = action =>
  48. // {
  49. // if (DynamicGridUtils.Edit(Settings))
  50. // SaveSettings();
  51. // }
  52. // });
  53. }
  54. }