Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,Nom,Degats")] Arme arme)
 {
     if (ModelState.IsValid && ArmeValidator.Validate(arme, ModelState, db))
     {
         db.Entry(arme).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(arme));
 }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "Id,Nom,Degats")] Arme arme)
        {
            if (ModelState.IsValid && ArmeValidator.Validate(arme, ModelState, db))
            {
                db.Armes.Add(arme);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(arme));
        }