Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
 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));
 }