AccountsSetupActions.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. namespace PRSDesktop;
  11. public static class AccountsSetupActions
  12. {
  13. public static void Standard(IPanelHost host)
  14. {
  15. host.CreateSetupActionIfCanView<ContactType>("Contact Types", PRSDesktop.Resources.contacttype, (action) =>
  16. {
  17. var list = new MasterList(typeof(ContactType));
  18. list.ShowDialog();
  19. });
  20. host.CreateSetupActionIfCanView<TaxCode>("Tax Codes", PRSDesktop.Resources.taxcode, (action) =>
  21. {
  22. var list = new MasterList(typeof(TaxCode));
  23. list.ShowDialog();
  24. });
  25. host.CreateSetupActionIfCanView<ReceiptType>("Receipt Types", PRSDesktop.Resources.receipt, (action) =>
  26. {
  27. var list = new MasterList(typeof(ReceiptType));
  28. list.ShowDialog();
  29. });
  30. host.CreateSetupActionIfCanView<PaymentType>("Payment Types", PRSDesktop.Resources.payment, (action) =>
  31. {
  32. var list = new MasterList(typeof(PaymentTerms));
  33. list.ShowDialog();
  34. });
  35. host.CreateSetupActionIfCanView<PaymentTerms>("Payment Terms", PRSDesktop.Resources.assignments, (action) =>
  36. {
  37. var list = new MasterList(typeof(PaymentTerms));
  38. list.ShowDialog();
  39. });
  40. host.CreateSetupActionIfCanView<CostCentre>("Cost Centres", PRSDesktop.Resources.costcentre, (action) =>
  41. {
  42. var list = new MasterList(typeof(CostCentre));
  43. list.ShowDialog();
  44. });
  45. host.CreateSetupActionIfCanView<GLCode>("GL Codes", PRSDesktop.Resources.glcode, (action) =>
  46. {
  47. var list = new MasterList(typeof(GLCode));
  48. list.ShowDialog();
  49. });
  50. host.CreateSetupActionIfCanView<Locality>("Post Codes", PRSDesktop.Resources.map, (action) =>
  51. {
  52. var form = new PostCodeWindow();
  53. form.ShowDialog();
  54. });
  55. host.CreateSetupActionIfCanView<ForeignCurrency>("Foreign Currencies", PRSDesktop.Resources.payment, (action) =>
  56. {
  57. var list = new MasterList(typeof(ForeignCurrency));
  58. list.ShowDialog();
  59. });
  60. }
  61. public static void PurchaseOrderCategories(IPanelHost host)
  62. {
  63. host.CreateSetupActionIfCanView<PurchaseOrderCategory>("Purchase Order Categories", PRSDesktop.Resources.service, (action) =>
  64. {
  65. var list = new MasterList(typeof(PurchaseOrderCategory));
  66. list.ShowDialog();
  67. });
  68. }
  69. public static void CustomerSpreadsheetTemplates(IPanelHost host)
  70. {
  71. host.CreateSetupActionIfCanView<CustomerSpreadsheet>("Customer Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  72. {
  73. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Customer>();
  74. });
  75. }
  76. public static void SupplierSpreadsheetTemplates(IPanelHost host)
  77. {
  78. host.CreateSetupActionIfCanView<SupplierSpreadsheet>("Supplier Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  79. {
  80. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Supplier>();
  81. });
  82. }
  83. }