public ActionResult Create([Bind(Include = "CategoryId,CategoryName")] Category category) { if (ModelState.IsValid) { db.Category.Add(category); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
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)); }
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)); }
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)); }