Ejemplo n.º 1
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   Mar 18, 2017
        *  Function:     SaveFraud
        *  Purpose:      SaveFraud
        *  Inputs:       FraudCustomerDetailsDTO,FraudCardDetailDTO,WebFraudDetailDTO,userId
        *  Returns:      SaveAcctSignUpResponse
        *************************************/
        public async Task <SaveAcctSignUpResponse> SaveFraud(FraudCustomerDetailsViewModel fraudCustomerDetail, FraudCardDetailsViewModel fraudCardDetail, FraudIncidentsViewModel webFraudDetail, string userId)
        {
            Logger.Info("Invoking SaveFraud function");
            var response = new SaveAcctSignUpResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var pukalAcctDAO           = scope.Resolve <IFraudOpDAO>();
                    var controlDAO             = scope.Resolve <IControlDAO>();
                    var fraudCustomerDetailDto = Mapper.Map <FraudCustomerDetailsViewModel, FraudCustomerDetailsDTO>(fraudCustomerDetail);
                    var fraudCardDetailDto     = Mapper.Map <FraudCardDetailsViewModel, FraudCardDetailDTO>(fraudCardDetail);
                    var webFraudDetailDto      = Mapper.Map <FraudIncidentsViewModel, WebFraudDetailDTO>(webFraudDetail);
                    var result = await pukalAcctDAO.SaveFraud(fraudCustomerDetailDto, fraudCardDetailDto, webFraudDetailDto, userId);

                    var message = await controlDAO.GetMessageCode(result.Flag);

                    response.desp = message.Descp;
                    response.flag = message.Flag;
                    response.returnValue.BatchId = result.paraOut.BatchId;
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in SaveFraud: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.flag    = 1;
                response.Message = msg;
            }
            return(response);
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> SaveFraud(FraudCustomerDetailsViewModel fraudCustomerDetailsViewModel, FraudCardDetailsViewModel fraudCardDetailsViewModel, FraudIncidentsViewModel fraudIncidentsViewModel)
        {
            var result = await FraudOpService.SaveFraud(fraudCustomerDetailsViewModel, fraudCardDetailsViewModel, fraudIncidentsViewModel, GetUserId);

            return(Json(new { resultCd = result, _eventId = result.returnValue.BatchId }));
        }