Esempio n. 1
0
        public ActionResult Index(int storeId, string storeName)
        {
            ViewBag.StoreName = storeName;
            ViewBag.StoreID   = storeId;

            HttpContext.Session.SetString("StoreID", storeId.ToString());
            HttpContext.Session.SetString("storeName", storeId.ToString());

            List <InventoryViewModel> inventoryViewModels = _buisnessLogicClass.GetAllTheInventoryFromStore(storeId);

            return(View(inventoryViewModels));
        }
        public ActionResult CreateCart()
        {
            int StoreID = (int)HttpContext.Session.GetInt32("StoreID");
            int UserID  = (int)HttpContext.Session.GetInt32("UserID");

            //Verify if it doesnt exist an pending Order, returns the OrderID created or existing:
            int OrderID = _buisnessLogicClass.CreateOrUpdatePendingOrder(UserID, StoreID);

            HttpContext.Session.SetInt32("OrderID", OrderID);

            //Get all the Inventory from the store.
            List <InventoryViewModel> inventories = _buisnessLogicClass.GetAllTheInventoryFromStore(StoreID);

            return(View(inventories));
        }