QuoteSetupActions.cs 3.1 KB

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