AccountsSetupActions.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using Comal.Classes;
  2. using InABox.DynamicGrid;
  3. using InABox.Wpf;
  4. using PRSDesktop.Components.Spreadsheet;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  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(PaymentType));
  33. list.ShowDialog();
  34. });
  35. host.CreateSetupActionIfCanView<CostCentre>("Cost Centres", PRSDesktop.Resources.costcentre, (action) =>
  36. {
  37. var list = new MasterList(typeof(CostCentre));
  38. list.ShowDialog();
  39. });
  40. host.CreateSetupActionIfCanView<GLCode>("GL Codes", PRSDesktop.Resources.glcode, (action) =>
  41. {
  42. var list = new MasterList(typeof(GLCode));
  43. list.ShowDialog();
  44. });
  45. }
  46. public static void PurchaseOrderCategories(IPanelHost host)
  47. {
  48. host.CreateSetupActionIfCanView<PurchaseOrderCategory>("Purchase Order Categories", PRSDesktop.Resources.service, (action) =>
  49. {
  50. var list = new MasterList(typeof(PurchaseOrderCategory));
  51. list.ShowDialog();
  52. });
  53. }
  54. public static void CustomerSpreadsheetTemplates(IPanelHost host)
  55. {
  56. host.CreateSetupActionIfCanView<CustomerSpreadsheet>("Customer Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  57. {
  58. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Customer>();
  59. });
  60. }
  61. public static void SupplierSpreadsheetTemplates(IPanelHost host)
  62. {
  63. host.CreateSetupActionIfCanView<SupplierSpreadsheet>("Supplier Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  64. {
  65. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Supplier>();
  66. });
  67. }
  68. }