public ActionResult ShoppingCart(GoodsList Selected, string action)
        {
            CheckUserSession();
            CartDisplayHide();
            CheckAvailabillity();
            switch (action)
            {
            case "Buy":
                return(View("PostView", Selected));

            case "Sign out":
                SignOut();
                return(RedirectToAction("Authorization", "Account"));

            case "Continue":
                CheckUserSession();
                CartDisplayHide();
                return(View("Index", Selected));

            default:
            {
                CheckUserSession();
                CartDisplayHide();
                AddedGoodsToCart(Selected);
                return(View(Selected));
            }
            }
        }
 public ActionResult ShoppingCart(GoodsList Selected)
 {
     CartDisplayHide();
     CheckUserSession();
     CheckAvailabillity();
     return(View(Selected));
 }
        public ActionResult Index()
        {
            CartDisplayHide();
            BlockUnblockToBuy();
            CheckUserSession();
            GoodsList AllGoodsList = new GoodsList(new List <Button>());

            AllGoodsList.AllGoods = new DAOImplements().LoadAllGoods();
            for (int i = 0; i < AllGoodsList.AllGoods.Count; i++)
            {
                AllGoodsList.Buttons.Add(new Button(i + "", false));
            }
            return(View(AllGoodsList));
        }
        /// <summary>
        /// Добавление товара в корзину
        /// </summary>
        /// <param name="selected"></param>
        /// <returns></returns>
        private GoodsList AddedGoodsToCart(GoodsList selected)
        {
            int count = 0;

            for (int i = 0; i < selected.AllGoods.Count; i++)
            {
                if (Request.Form[selected.Buttons[i].Name] != null)
                {
                    selected.Buttons[i].PressBtn = !selected.Buttons[i].PressBtn;
                }
                if (selected.Buttons[i].PressBtn)
                {
                    count++;
                }
                CartDisplayHide();
                Session["select"] = count;
            }
            return(selected);
        }
        public ActionResult GraphicsCards(GoodsList Selected, string action)
        {
            BlockUnblockToBuy();
            CartDisplayHide();
            CheckUserSession();
            CheckAvailabillity();
            switch (action)
            {
            case "Cart":
                return(View("ShoppingCart", Selected));

            case "Sign out":
                SignOut();
                return(RedirectToAction("Authorization", "Account"));

            default:
            {
                AddedGoodsToCart(Selected);
                return(View(Selected));
            }
            }
        }
        public ActionResult Index(GoodsList Selected, string action)
        {
            CheckUserSession();
            CartDisplayHide();
            BlockUnblockToBuy();
            switch (action)
            {
            case "Desktop":
                return(View("Desktops", Selected));

            case "GraphicsCards":
                return(View("GraphicsCards", Selected));

            case "Laptops":
                return(View("GraphicsCards", Selected));

            case "Monitors":
                return(View("GraphicsCards", Selected));

            case "Networking":
                return(View("GraphicsCards", Selected));

            case "Virtual Reality":
                return(View("GraphicsCards", Selected));

            case "Accessories":
                return(View("GraphicsCards", Selected));

            case "Components":
                return(View("GraphicsCards", Selected));

            case "Sign out":
                SignOut();
                return(RedirectToAction("Authorization", "Account"));
            }
            return(View(Selected));
        }
 public ActionResult PostView(GoodsList Selected)
 {
     return(View(Selected));
 }