Beispiel #1
0
        /*************************************
        *  Created by:   dandy
        *  Created on:  May 22, 2017
        *  Function:     GetGeneralInfo
        *  Purpose:      GetGeneralInfo
        *  Inputs:       cardNo
        *  Returns:      CardHolderResponse
        *************************************/
        public async Task <CardHolderResponse> GetGeneralInfo(string cardNo)
        {
            Logger.Info("Invoking GetCardList fuction use EF to call SP");
            var response = new CardHolderResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var applicantHolderDAO = scope.Resolve <ICardHolderDAO>();
                    var cardHolderInfo     = await applicantHolderDAO.GeneralInfoSelect(cardNo);

                    if (cardHolderInfo != null)
                    {
                        cardHolderInfo.CardNo   = cardNo;
                        response.cardHolderInfo = Mapper.Map <CardHolderInfoDTO, CardHolderInfoModel>(cardHolderInfo);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetCardList: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #2
0
        /*************************************
        *  Created by:   Tuan
        *  Created on:   June 01, 2017
        *  Function:     GetLocationAcceptance
        *  Purpose:      GetLocationAcceptance
        *  Inputs:       acctNo,busnLoc,cardNo
        *  Returns:      CardHolderResponse
        *************************************/
        public async Task <CardHolderResponse> GetLocationAcceptance(string acctNo, string busnLoc, string cardNo)
        {
            Logger.Info("Invoking GetLocationAcceptance fuction use EF to call SP");
            var response = new CardHolderResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var applicantHolderDAO = scope.Resolve <ICardHolderDAO>();
                    var locationAccept     = await applicantHolderDAO.LocationAcceptanceSelect(acctNo, busnLoc, cardNo);

                    if (locationAccept != null)
                    {
                        response.locationAccept = Mapper.Map <LocationAcceptDTO, LocationAcceptListModel>(locationAccept);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetLocationAcceptance: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #3
0
        /*************************************
        *  Created by:   dandy
        *  Created on:  May 24, 2017
        *  Function:     GetCardHolders
        *  Purpose:      GetCardHolders
        *  Inputs:       accountNo
        *  Returns:      CardHolderResponse
        *************************************/
        public async Task <CardHolderResponse> GetCardHolders(string accountNo)
        {
            Logger.Info("Invoking GetCardHolders fuction use EF to call SP");
            var response = new CardHolderResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var applicantHolderDAO = scope.Resolve <ICardHolderDAO>();
                    var cardHolderInfors   = await applicantHolderDAO.CardHolderList(accountNo);

                    if (cardHolderInfors.Count() > 0)
                    {
                        response.cardHolderInfos = Mapper.Map <List <CardHolderInfoModel> >(cardHolderInfors);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetCardHolders: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #4
0
        /*************************************
        *  Created by:   dandy
        *  Created on:  May 23, 2017
        *  Function:     GetPersonInfo
        *  Purpose:      GetPersonInfo
        *  Inputs:       cardNo
        *  Returns:      CardHolderResponse
        *************************************/
        public async Task <CardHolderResponse> GetPersonInfo(string entityId)
        {
            Logger.Info("Invoking GetPersonInfo fuction use EF to call SP");
            var response = new CardHolderResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var applicantHolderDAO = scope.Resolve <ICardHolderDAO>();
                    var personalInfo       = await applicantHolderDAO.PersonInfoSelect(entityId);

                    if (personalInfo != null)
                    {
                        personalInfo.EntityId = entityId;
                        response.personalInfo = Mapper.Map <PersonalInfoDTO, PersonInfoModel>(personalInfo);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetPersonInfo: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #5
0
        /*************************************
        *  Created by:   dandy
        *  Created on:  May 23, 2017
        *  Function:     GetChangedAcctStsDetail
        *  Purpose:      GetChangedAcctStsDetail
        *  Inputs:       id,refCd
        *  Returns:      CardHolderResponse
        *************************************/
        public async Task <CardHolderResponse> GetChangedAcctStsDetail(string id, string refCd)
        {
            Logger.Info("Invoking GetChangedAcctStsDetail fuction use EF to call SP");
            var response = new CardHolderResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var applicantHolderDAO = scope.Resolve <ICardHolderDAO>();
                    var controlDAO         = scope.Resolve <IControlDAO>();
                    var personalInfo       = await applicantHolderDAO.FtChangedAcctStsDetail(id, refCd);

                    response.changeStatus = Mapper.Map <ChangeStatusDTO, ChangeStatus>(personalInfo);
                    if (refCd.ToUpper() == "CARD")
                    {
                        response.changeStatus.CurrentStatus = await controlDAO.GetRefLib("CardSts", "1");

                        response.changeStatus.RefType = await controlDAO.GetRefLib("EventType");

                        response.changeStatus.ReasonCode = await controlDAO.GetRefLib("ReasonCd", "32");

                        response.changeStatus.ChangeStatusTo = await controlDAO.GetRefLib("CardSts", "1");
                    }
                    else if (refCd.ToUpper() == "MERCH")
                    {
                        response.changeStatus.CurrentStatus = await controlDAO.GetRefLib("MerchAcctSts");

                        response.changeStatus.RefType = await controlDAO.GetRefLib("EventType");

                        response.changeStatus.ReasonCode = await controlDAO.GetRefLib("ReasonCd");

                        response.changeStatus.ChangeStatusTo = await controlDAO.GetRefLib("MerchAcctSts");
                    }
                    else if (refCd.ToUpper() == "BUSN")
                    {
                        response.changeStatus.CurrentStatus = await controlDAO.GetRefLib("MerchAcctSts");

                        response.changeStatus.RefType = await controlDAO.GetRefLib("EventType");

                        response.changeStatus.ReasonCode = await controlDAO.GetRefLib("MerchReasonCd");

                        response.changeStatus.ChangeStatusTo = await controlDAO.GetRefLib("MerchAcctSts");
                    }
                    else if (refCd.ToUpper() == "APPC")
                    {
                        response.changeStatus.CurrentStatus = await controlDAO.GetRefLib("AppcSts");

                        response.changeStatus.RefType = await controlDAO.GetRefLib("EventType");

                        response.changeStatus.ReasonCode = await controlDAO.GetRefLib("ReasonCd");

                        response.changeStatus.ChangeStatusTo = await controlDAO.GetRefLib("AppcSts");
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetChangedAcctStsDetail: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }