You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

  1. using BankOfCeylon.BankOfCeylonAPIService;
  2. using BracBank.BracBankApiService;
  3. using Cebuana.ApiService;
  4. using Common.TPService;
  5. using Common.Utility;
  6. using Donga.DongaAPIService;
  7. using GMENepal.GMENepalAPIService;
  8. using log4net;
  9. using Transfast.ApiServices;
  10. using Unity;
  11. namespace Business.BusinessLogic.TPApiServices.Factory
  12. {
  13. public class ApiFactoryServices : IApiFactoryServices
  14. {
  15. private readonly ILog log = LogManager.GetLogger(typeof(ApiFactoryServices));
  16. private readonly UnityContainer _container = new UnityContainer();
  17. private ITPApiServices apiFactory;
  18. public ITPApiServices GetServices(string providerNo)
  19. {
  20. if (providerNo == GetStatic.ReadWebConfig("donga", ""))
  21. {
  22. log.Debug("Choose Provider as DongaAPI");
  23. //apiFactory = _container.Resolve<DongaAPI>();
  24. apiFactory = _container.Resolve<DongApiV2>();
  25. }
  26. else if (providerNo == GetStatic.ReadWebConfig("transfast", ""))
  27. {
  28. log.Debug("Choose Provider as TFAPI");
  29. apiFactory = _container.Resolve<TFAPI>();
  30. }
  31. else if (providerNo == GetStatic.ReadWebConfig("gmenepal", ""))
  32. {
  33. log.Debug("Choose Provider as GMENepalAPI");
  34. apiFactory = _container.Resolve<GMENepalAPI>();
  35. }
  36. else if (providerNo == GetStatic.ReadWebConfig("bankofceylon", ""))
  37. {
  38. log.Debug("Choose Provider as bankofceylon");
  39. apiFactory = _container.Resolve<BankOfCeylonAPI>();
  40. }
  41. else if (providerNo == GetStatic.ReadWebConfig("Bracbank", ""))
  42. {
  43. log.Debug("Choose Provider as Brac Bank");
  44. apiFactory = _container.Resolve<BracBankAPI>();
  45. }
  46. else if (providerNo == GetStatic.ReadWebConfig("Cebuana", ""))
  47. {
  48. log.Debug("Choose Provider as Cebuana ");
  49. apiFactory = _container.Resolve<CebuanaApi>();
  50. }
  51. return apiFactory;
  52. }
  53. }
  54. }