AccountsSetupActions.cs 3.1 KB

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