QuoteSetupActions.cs 3.6 KB

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