public ActionResult Edit([Bind(Include = "DeveloperId,Name,Description")] Developer developer) { bool Banned = false; foreach (Blacklist blacklist in dbBlacklist.Blacklists.ToList()) { if (blacklist.BlacklistIP == Request.UserHostAddress) { Banned = true; } } if (ModelState.IsValid && Banned == false) { db.Entry(developer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } if (Banned == true) { return(RedirectToAction("../Blacklists/UserBlacklist/")); } else { return(View(developer)); } }
public ActionResult Edit([Bind(Include = "DeveloperID,DeveloperName,StartDate,Description,GamesProduced")] Developer developer) { if (ModelState.IsValid) { db.Entry(developer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(developer)); }