Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "CategoryId,CategoryName")] Category category)
        {
            if (ModelState.IsValid)
            {
                db.Category.Add(category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(category));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "ReviewId,Rating,Comment,ReviewDate")] Review review)
        {
            if (ModelState.IsValid)
            {
                db.Review.Add(review);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(review));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "UserID,Email,Username,Password,ConfirmPassword,Tokens,PhoneNumber,UserType")] Register register)
        {
            if (ModelState.IsValid)
            {
                db.Register.Add(register);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(register));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "GameID,CategoryId,GameName,Price,Time,Image")] Games games)
        {
            if (ModelState.IsValid)
            {
                db.Games.Add(games);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CategoryId = new SelectList(db.Category, "CategoryId", "CategoryName", games.CategoryId);
            return(View(games));
        }