Пример #1
0
        public ActionResult NextStep()
        {
            //var checkout = Session["checkout"] as CheckOutDTO;
            //var step = (CheckoutSteps)Session["step"];
            var step = (CheckoutSteps)checkout.Step;

            switch (step)
            {
            //case CheckoutSteps.Coupon:
            //step = CheckoutSteps.Address;
            //_checkOutService.SetStep(User.Identity.GetUserId(), (int)CheckoutSteps.Address);
            //break;
            case CheckoutSteps.Address:
                if (checkout.AvailableAddresses.Count <= 0)
                {
                    return(Json(new OperationDetails(false, "يجب أن تملك عنوان على الأقل", "")));
                }
                else
                {     //step = CheckoutSteps.Payment;
                    _checkOutService.SetStep(User.Identity.GetUserId(), (int)CheckoutSteps.Payment);
                }
                break;
            }
            //ViewData["Step"] = checkout.Step;
            return(Json(new OperationDetails(true, "", "")));
        }