Exemplo n.º 1
0
        //______________________________________________________________________________________

        /// <summary>
        /// Product/EmptyCart/abd
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        public ActionResult EmptyCart(string id)
        {
            try
            {
                if (Session["usertype"] != null)
                {
                    string LoggedInUser = @User.Identity.Name;
                    ShoppingCartImplementation.EmptyCart(id);

                    return(RedirectToAction("Cart", "Product"));
                }
                else
                {
                    return(RedirectToAction("Cart", "Product"));
                }
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, "UI Policy");
                if (rethrow)
                {
                    throw;
                }
                return(RedirectToAction("Index", "Product"));
            }
        }
Exemplo n.º 2
0
        public ActionResult CheckOut(CheckOutModel checkout)
        {
            try
            {
                checkout.userdata.UserId = @User.Identity.Name;

                ViewBag.checkOutMessage = LetsShopImplementation.PlaceOrder(checkout);
                ShoppingCartImplementation.EmptyCart(@User.Identity.Name);
                return(View());
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
Exemplo n.º 3
0
        public ActionResult CheckOut(CheckOutModel checkout)
        {
            try
            {
                checkout.userdata.UserId = @User.Identity.Name;

                ViewBag.checkOutMessage = LetsShopImplementation.PlaceOrder(checkout);
                ShoppingCartImplementation.EmptyCart(@User.Identity.Name);
                return(View());
            }
            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, "UI Policy");
                if (rethrow)
                {
                    throw;
                }
                return(View());
            }
        }
Exemplo n.º 4
0
        //______________________________________________________________________________________

        /// <summary>
        /// Product/EmptyCart/abd
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        public ActionResult EmptyCart(string id)
        {
            try
            {
                if (Session["usertype"] != null)
                {
                    string LoggedInUser = @User.Identity.Name;
                    ShoppingCartImplementation.EmptyCart(id);

                    return(RedirectToAction("Cart", "Product"));
                }
                else
                {
                    return(RedirectToAction("Cart", "Product"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Product"));
            }
        }