public ActionResult Edit([Bind(Include = "Id,Description,UserId")] WordGroup wordGroup) { if (ModelState.IsValid) { db.Entry(wordGroup).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wordGroup)); }
public ActionResult Edit([Bind(Include = "Id,Name,Code")] Language language) { if (CheckAdminUser() == false) { return(RedirectToAction("Index", "Home")); } if (ModelState.IsValid) { db.Entry(language).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(language)); }
public ActionResult Edit([Bind(Include = "Id,Username,Password,Name")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } if (CheckAdminUser()) { return(View(user)); } else { return(RedirectToAction("Index", "Home")); } }