QuoteSetupActions.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using Comal.Classes;
  2. using InABox.DynamicGrid;
  3. using InABox.Wpf;
  4. using PRSDesktop.Components.Spreadsheet;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace PRSDesktop;
  11. public static class QuoteSetupActions
  12. {
  13. public static void Standard(IPanelHost host)
  14. {
  15. host.CreateSetupActionIf<CanModifyQuoteStatuses>("Status Codes", PRSDesktop.Resources.quotestatus, (action) =>
  16. {
  17. var list = new MasterList(typeof(QuoteStatus));
  18. list.ShowDialog();
  19. });
  20. host.CreateSetupActionIfCanView<QuoteDesignSection>("Design Sections", PRSDesktop.Resources.design, (action) =>
  21. {
  22. var list = new MasterList(typeof(QuoteDesignSection));
  23. list.ShowDialog();
  24. });
  25. host.CreateSetupSeparator();
  26. host.CreateSetupActionIfCanView<KitCondition>("Kit Conditions", PRSDesktop.Resources.kitcondition, (action) =>
  27. {
  28. var list = new MasterList(typeof(KitCondition));
  29. list.ShowDialog();
  30. });
  31. host.CreateSetupActionIfCanView<KitFormula>("Kit Formulae", PRSDesktop.Resources.kitformula, (action) =>
  32. {
  33. var list = new MasterList(typeof(KitFormula));
  34. list.ShowDialog();
  35. });
  36. host.CreateSetupActionIfCanView<CostSheetType>("Cost Sheet Types", PRSDesktop.Resources.costsheettype, (action) =>
  37. {
  38. var list = new MasterList(typeof(CostSheetType));
  39. list.ShowDialog();
  40. });
  41. host.CreateSetupActionIfCanView<CostSheetBrand>("Cost Sheet Brands", PRSDesktop.Resources.costsheetbrand, (action) =>
  42. {
  43. var list = new MasterList(typeof(CostSheetBrand));
  44. list.ShowDialog();
  45. });
  46. host.CreateSetupActionIfCanView<CostSheetSection>("Cost Sheet Sections", PRSDesktop.Resources.costsheetsection, (action) =>
  47. {
  48. var list = new MasterList(typeof(CostSheetSection));
  49. list.ShowDialog();
  50. });
  51. host.CreateSetupSeparator();
  52. host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbols", PRSDesktop.Resources.pencil, (action) =>
  53. {
  54. var list = new MasterList(typeof(QuoteDiagramSymbol), "Section.Name");
  55. list.ShowDialog();
  56. QuoteDiagramSymbolCache.Refresh();
  57. });
  58. host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbol Types", PRSDesktop.Resources.attachment, (action) =>
  59. {
  60. var list = new MasterList(typeof(QuoteDiagramSymbolSection));
  61. list.ShowDialog();
  62. QuoteDiagramSymbolCache.Refresh();
  63. });
  64. host.CreateSetupActionIfCanView<QuoteTakeOffUnit>("Dimension Types", PRSDesktop.Resources.box, (action) =>
  65. {
  66. var list = new MasterList(typeof(QuoteTakeOffUnit));
  67. list.ShowDialog();
  68. });
  69. host.CreateSetupSeparator();
  70. host.CreateSetupActionIfCanView<QuoteSpreadsheet>("Job Statuses", PRSDesktop.Resources.box, (action) =>
  71. {
  72. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Quote>();
  73. });
  74. }
  75. }