예제 #1
0
        /// <summary>
        /// Execute processing.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>ResponseModel</returns>
        private CheckoutResponseModel Execute(CheckoutRequestModel request)
        {
            // Local variable declaration
            CheckoutResponseModel responseModel = null;
            InitDataModel         inputObject   = null;
            InitDataModel         resultObject  = new InitDataModel();

            // Variable initialize
            responseModel = new CheckoutResponseModel();

            // Execute convert input.
            inputObject = Convert(request);

            ClientCheckoutDao checkoutDao = new ClientCheckoutDao();

            resultObject.AcceptSlipNo = checkoutDao.makeCheckout(inputObject.Accept, inputObject.Cart);

            // Send mail
            //SendEmail(inputObject.Accept.ClientCd, inputObject.Accept.AcceptSlipNo);

            // Execute convert ouput.
            responseModel = Convert(resultObject);

            return(responseModel);
        }
예제 #2
0
        public async Task <Contracts.DataModels.Tiqets.TiqetProductCheckoutDetail> SaveCheckoutDetails(UpdateProductCommand command)
        {
            try
            {
                CheckoutResponseModel checkoutdetails = new CheckoutResponseModel();
                checkoutdetails = Mapper <CheckoutResponseModel> .MapFromJson((await GetCheckoutDetails(command.productId)));

                if (checkoutdetails.success)
                {
                    var tiqetsCheckoutDetails = _tiqetProductCheckoutDetailRepository.GetByProductId(command.productId);
                    if (tiqetsCheckoutDetails == null)
                    {
                        tiqetsCheckoutDetails = _tiqetProductCheckoutDetailRepository.Save(new Contracts.DataModels.Tiqets.TiqetProductCheckoutDetail
                        {
                            ProductId       = command.productId,
                            MustKnow        = checkoutdetails.additional_information.must_know,
                            GoodToKnow      = checkoutdetails.additional_information.good_to_know,
                            PrePurchase     = checkoutdetails.additional_information.pre_purchase,
                            Usage           = checkoutdetails.additional_information.usage,
                            Excluded        = checkoutdetails.additional_information.excluded,
                            Included        = checkoutdetails.additional_information.included,
                            PostPurchase    = checkoutdetails.additional_information.post_purchase,
                            HasTimeSlot     = checkoutdetails.has_timeslots,
                            HasDynamicPrice = checkoutdetails.has_dynamic_pricing,
                            IsEnabled       = true,
                            CreatedBy       = command.ModifiedBy,
                            CreatedUtc      = DateTime.UtcNow
                        });
                    }
                    else
                    {
                        tiqetsCheckoutDetails.MustKnow        = checkoutdetails.additional_information.must_know;
                        tiqetsCheckoutDetails.GoodToKnow      = checkoutdetails.additional_information.good_to_know;
                        tiqetsCheckoutDetails.PrePurchase     = checkoutdetails.additional_information.pre_purchase;
                        tiqetsCheckoutDetails.Usage           = checkoutdetails.additional_information.usage;
                        tiqetsCheckoutDetails.Excluded        = checkoutdetails.additional_information.excluded;
                        tiqetsCheckoutDetails.Included        = checkoutdetails.additional_information.included;
                        tiqetsCheckoutDetails.PostPurchase    = checkoutdetails.additional_information.post_purchase;
                        tiqetsCheckoutDetails.HasTimeSlot     = checkoutdetails.has_timeslots;
                        tiqetsCheckoutDetails.HasDynamicPrice = checkoutdetails.has_dynamic_pricing;
                        tiqetsCheckoutDetails.IsEnabled       = true;
                        tiqetsCheckoutDetails.CreatedBy       = command.ModifiedBy;
                        tiqetsCheckoutDetails.CreatedUtc      = DateTime.UtcNow;
                        _tiqetProductCheckoutDetailRepository.Save(tiqetsCheckoutDetails);
                    }
                    return(tiqetsCheckoutDetails);
                }
                return(null);
            }
            catch (Exception e)
            {
                _logger.Log(LogCategory.Error, new Exception("Failed to get checkout Details", e));
                return(null);
            }
        }
예제 #3
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private CheckoutResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            CheckoutResponseModel responseModel = null;

            // Variable initialize
            responseModel = new CheckoutResponseModel();

            responseModel.AcceptSlipNo = resultObject.AcceptSlipNo;

            return(responseModel);
        }