/************************************* * Created by: Tuan Tran * Created on: March 3, 2017 * Function: GetMerchAgreementList * Purpose: GetMerchAgreementList * Inputs: * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetMerchAgreementList() { Logger.Info("Invoking GetMerchAgreementList function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var result = await mechSignUpDAO.GetMerchAgreementList(); if (result.Count() > 0) { response.merchAgreements = Mapper.Map <IList <MerchAgreementGeneralInfoDTO>, IList <MA_GeneralInfo> >(result); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetMerchAgreementList: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: june 30, 2017 * Function: GetMerchProductPriceSearch * Purpose: GetMerchProductPriceSearch * Inputs: busnLocation,ProdCd,effDateFrom,effDateTo,isListSelect * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetMerchProductPriceSearch(MerchProductPrize merchProductPrize, bool isListSelect) { Logger.Info("Invoking GetMerchProductPriceSearch function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var merchProductPrizeDto = Mapper.Map <MerchProductPrize, MerchProductPrizeDTO>(merchProductPrize); var results = await mechSignUpDAO.WebMerchProductPriceSearch(merchProductPrizeDto.BusnLocation, merchProductPrizeDto.ProdCd, merchProductPrizeDto.StartDate, merchProductPrizeDto.EndDate, isListSelect); if (results.Count() > 0) { response.merchProductPrizes = Mapper.Map <List <MerchProductPrizeDTO>, List <MerchProductPrize> >(results); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetMerchProductPriceSearch: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: June 30, 2017 * Function: GetMerchChgOwnership * Purpose: GetMerchChgOwnership * Inputs: busnLocation * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetMerchChgOwnership(string busnLocation) { Logger.Info("Invoking GetMerchChgOwnership function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var result = await mechSignUpDAO.WebMerchChgOwnershipSelect(busnLocation); if (result != null) { response.merchChangeOwnership = Mapper.Map <MerchChangeOwnershipDTO, MerchChangeOwnership>(result); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetMerchChgOwnership: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: June 30, 2017 * Function: GetIFrameMerchGeneralInfo * Purpose: GetIFrameMerchGeneralInfo * Inputs: busnLocation,category,month,year * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetIFrameMerchGeneralInfoes(string busnLocation, int category, int month, int year) { Logger.Info("Invoking GetIFrameMerchGeneralInfoes function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var results = await mechSignUpDAO.iFrameMerchTxnListSelect(busnLocation, category, month, year); if (results.Count() > 0) { response.eServices = Mapper.Map <List <EServiceDTO>, List <eService> >(results); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetIFrameMerchGeneralInfoes: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: june 30, 2017 * Function: GetBusnLocTerms * Purpose: GetBusnLocTerms * Inputs: busnLocation * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetBusnLocTerms(string busnLocation) { Logger.Info("Invoking GetBusnLocTerms function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var controlDAO = scope.Resolve <IControlDAO>(); var results = await mechSignUpDAO.GetBusnLocTermList(busnLocation); if (results.Count() > 0) { response.busnLocTerminals = Mapper.Map <List <BusnLocTerminalDTO>, List <BusnLocTerminal> >(results); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetBusnLocTerms: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: June 30, 2017 * Function: GetIFrameMerchGeneralInfo * Purpose: GetIFrameMerchGeneralInfo * Inputs: busnLocation * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetIFrameMerchGeneralInfo(string busnLocation) { Logger.Info("Invoking GetIFrameMerchGeneralInfo function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var result = await mechSignUpDAO.iFrameMerchGeneralInfoSelect(busnLocation); if (result != null) { response.eService = Mapper.Map <EServiceDTO, eService>(result); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetIFrameMerchGeneralInfo: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: June 30, 2017 * Function: GetMerchtPostedTxnSearch * Purpose: GetMerchtPostedTxnSearch * Inputs: * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetMerchtPostedTxnSearch(string accountNo, string busnLocation, string txnCd, string txnDate) { Logger.Info("Invoking GetMerchtPostedTxnSearch function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var results = await mechSignUpDAO.GetMerchtPostedTxnSearch(accountNo, busnLocation, txnCd, txnDate); if (results.Count() > 0) { response.merchPostedTxnSearches = Mapper.Map <List <MerchPostedTxnSearchDTO>, List <MerchPostedTxnSearch> >(results); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetMerchtPostedTxnSearch: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: june 30, 2017 * Function: GetBusinessLocationGeneralInfoDetail * Purpose: GetBusinessLocationGeneralInfoDetail * Inputs: busnLocation * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetBusinessLocationGeneralInfoDetail(string busnLocation) { Logger.Info("Invoking GetBusinessLocationGeneralInfoDetail function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var result = await mechSignUpDAO.GetBusinessLocationGeneralInfoDetail(busnLocation); if (result != null) { response.merchantDetail = Mapper.Map <MerchGeneralInfoDTO, MerchantDetails>(result); response.merchantDetail.AutoDebitInd = true; } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetBusinessLocationGeneralInfoDetail: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: june 30, 2017 * Function: GetMAGeneralInfoDetail * Purpose: GetMAGeneralInfoDetail * Inputs: * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetBusnLocTermDetail(string termId, string busnLocation) { Logger.Info("Invoking GetBusnLocTermDetail function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var controlDAO = scope.Resolve <IControlDAO>(); var result = await mechSignUpDAO.GetBusnLocTermDetail(termId, busnLocation); if (result != null) { response.busnLocTerminal = Mapper.Map <BusnLocTerminalDTO, BusnLocTerminal>(result); response.busnLocTerminal.ReasonCd = await controlDAO.GetRefLib("TermReasonCd"); if (string.IsNullOrEmpty(result.Sts)) { response.busnLocTerminal.SelectedStatus = "A"; } else { response.busnLocTerminal.SelectedStatus = result.Sts; } } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetBusnLocTermDetail: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }
/************************************* * Created by: dandy boy * Created on: june 30, 2017 * Function: GetMAGeneralInfoDetail * Purpose: GetMAGeneralInfoDetail * Inputs: * Returns: MechSignUpResponse *************************************/ public async Task <MechSignUpResponse> GetMAGeneralInfoDetail(string accountNo) { Logger.Info("Invoking GetMAGeneralInfoDetail function"); var response = new MechSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var mechSignUpDAO = scope.Resolve <IMechSignUpDAO>(); var result = await mechSignUpDAO.GetMAGeneralInfoDetail(accountNo); if (result != null) { if (string.IsNullOrEmpty(result.Sts)) { result.Sts = "A"; } if (string.IsNullOrEmpty(result.ReasonCd)) { result.ReasonCd = "ACTV"; } response.merchGeneralInfo = Mapper.Map <MerchGeneralInfoDTO, MA_GeneralInfo>(result); } } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in GetMAGeneralInfoDetail: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.Message = msg; } return(response); }