AccountsSetupActions.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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(PaymentType));
  32. list.ShowDialog();
  33. });
  34. host.CreateSetupActionIfCanView<CostCentre>("Cost Centres", PRSDesktop.Resources.costcentre, (action) =>
  35. {
  36. var list = new MasterList(typeof(CostCentre));
  37. list.ShowDialog();
  38. });
  39. host.CreateSetupActionIfCanView<GLCode>("GL Codes", PRSDesktop.Resources.glcode, (action) =>
  40. {
  41. var list = new MasterList(typeof(GLCode));
  42. list.ShowDialog();
  43. });
  44. host.CreateSetupActionIfCanView<ForeignCurrency>("Foreign Currencies", PRSDesktop.Resources.payment, (action) =>
  45. {
  46. var list = new MasterList(typeof(ForeignCurrency));
  47. list.ShowDialog();
  48. });
  49. }
  50. public static void PurchaseOrderCategories(IPanelHost host)
  51. {
  52. host.CreateSetupActionIfCanView<PurchaseOrderCategory>("Purchase Order Categories", PRSDesktop.Resources.service, (action) =>
  53. {
  54. var list = new MasterList(typeof(PurchaseOrderCategory));
  55. list.ShowDialog();
  56. });
  57. }
  58. public static void CustomerSpreadsheetTemplates(IPanelHost host)
  59. {
  60. host.CreateSetupActionIfCanView<CustomerSpreadsheet>("Customer Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  61. {
  62. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Customer>();
  63. });
  64. }
  65. public static void SupplierSpreadsheetTemplates(IPanelHost host)
  66. {
  67. host.CreateSetupActionIfCanView<SupplierSpreadsheet>("Supplier Spreadsheet Templates", PRSDesktop.Resources.box, (action) =>
  68. {
  69. SpreadsheetTemplateGrid.ViewSpreadsheetTemplates<Supplier>();
  70. });
  71. }
  72. }