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.
|
|
using BankOfCeylon.BankOfCeylonAPIService; using BracBank.BracBankApiService; using Cebuana.ApiService; using Common.TPService; using Common.Utility; using Donga.DongaAPIService; using GMENepal.GMENepalAPIService; using log4net; using Transfast.ApiServices; using Unity;
namespace Business.BusinessLogic.TPApiServices.Factory { public class ApiFactoryServices : IApiFactoryServices { private readonly ILog log = LogManager.GetLogger(typeof(ApiFactoryServices)); private readonly UnityContainer _container = new UnityContainer(); private ITPApiServices apiFactory;
public ITPApiServices GetServices(string providerNo) { if (providerNo == GetStatic.ReadWebConfig("donga", "")) { log.Debug("Choose Provider as DongaAPI"); //apiFactory = _container.Resolve<DongaAPI>();
apiFactory = _container.Resolve<DongApiV2>(); }
else if (providerNo == GetStatic.ReadWebConfig("transfast", "")) { log.Debug("Choose Provider as TFAPI"); apiFactory = _container.Resolve<TFAPI>(); } else if (providerNo == GetStatic.ReadWebConfig("gmenepal", "")) { log.Debug("Choose Provider as GMENepalAPI"); apiFactory = _container.Resolve<GMENepalAPI>(); } else if (providerNo == GetStatic.ReadWebConfig("bankofceylon", "")) { log.Debug("Choose Provider as bankofceylon"); apiFactory = _container.Resolve<BankOfCeylonAPI>(); } else if (providerNo == GetStatic.ReadWebConfig("Bracbank", "")) { log.Debug("Choose Provider as Brac Bank"); apiFactory = _container.Resolve<BracBankAPI>(); } else if (providerNo == GetStatic.ReadWebConfig("Cebuana", "")) { log.Debug("Choose Provider as Cebuana "); apiFactory = _container.Resolve<CebuanaApi>(); } return apiFactory; } } }
|