예제 #1
0
        public ActionResult Game(string name)
        {
            //display a game onto the user when selecting order now
            GameDal dal = new GameDal();
            Game    g   = new Game();

            g = dal.findGame(name);
            return(View(g));
        }
예제 #2
0
        public ActionResult addToCart(string name)
        {
            //game dal refrense to add a game to cart
            GameDal dal = new GameDal();
            Game    g   = new Game();

            //find game by game name
            g = dal.findGame(name);

            //adds the found game to cart
            Global.cart.Add(g);
            //updates sum
            Global.sum    += Int32.Parse(g.price);
            Session["sum"] = Global.sum.ToString();

            //shows current cart
            return(View("viewcart"));
        }