QuoteSetupActions.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. host.CreateSetupActionIf<CanModifyQuoteStatuses>("Status Codes", PRSDesktop.Resources.quotestatus, (action) =>
  17. {
  18. var list = new MasterList(typeof(QuoteStatus));
  19. list.ShowDialog();
  20. });
  21. host.CreateSetupActionIfCanView<QuoteDesignSection>("Design Sections", PRSDesktop.Resources.design, (action) =>
  22. {
  23. var list = new MasterList(typeof(QuoteDesignSection));
  24. list.ShowDialog();
  25. });
  26. host.CreateSetupSeparator();
  27. host.CreateSetupActionIfCanView<KitCondition>("Kit Conditions", PRSDesktop.Resources.kitcondition, (action) =>
  28. {
  29. var list = new MasterList(typeof(KitCondition));
  30. list.ShowDialog();
  31. });
  32. host.CreateSetupActionIfCanView<KitFormula>("Kit Formulae", PRSDesktop.Resources.kitformula, (action) =>
  33. {
  34. var list = new MasterList(typeof(KitFormula));
  35. list.ShowDialog();
  36. });
  37. host.CreateSetupActionIfCanView<CostSheetType>("Cost Sheet Types", PRSDesktop.Resources.costsheettype, (action) =>
  38. {
  39. var list = new MasterList(typeof(CostSheetType));
  40. list.ShowDialog();
  41. });
  42. host.CreateSetupActionIfCanView<CostSheetBrand>("Cost Sheet Brands", PRSDesktop.Resources.costsheetbrand, (action) =>
  43. {
  44. var list = new MasterList(typeof(CostSheetBrand));
  45. list.ShowDialog();
  46. });
  47. host.CreateSetupActionIfCanView<CostSheetSection>("Cost Sheet Sections", PRSDesktop.Resources.costsheetsection, (action) =>
  48. {
  49. var list = new MasterList(typeof(CostSheetSection));
  50. list.ShowDialog();
  51. });
  52. host.CreateSetupSeparator();
  53. host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbols", PRSDesktop.Resources.pencil, (action) =>
  54. {
  55. var list = new MasterList(typeof(QuoteDiagramSymbol), "Section.Name");
  56. list.ShowDialog();
  57. QuoteDiagramSymbolCache.Refresh();
  58. });
  59. host.CreateSetupActionIfCanView<QuoteDiagramSymbol>("Symbol Types", PRSDesktop.Resources.attachment, (action) =>
  60. {
  61. var list = new MasterList(typeof(QuoteDiagramSymbolSection));
  62. list.ShowDialog();
  63. QuoteDiagramSymbolCache.Refresh();
  64. });
  65. host.CreateSetupActionIfCanView<QuoteTakeOffUnit>("Dimension Types", PRSDesktop.Resources.box, (action) =>
  66. {
  67. var list = new MasterList(typeof(QuoteTakeOffUnit));
  68. list.ShowDialog();
  69. });
  70. host.CreateSetupSeparator();
  71. host.CreateSetupActionIfCanView<QuoteSpreadsheet>("Job Statuses", PRSDesktop.Resources.box, (action) =>
  72. {
  73. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Quote>();
  74. });
  75. }
  76. }