public ActionResult DeleteConfirmed(int id) { TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db); TypeViking typeViking = typeVikingFactory.GetById(id); typeVikingFactory.Delete(ref typeViking); // Ajout d'un message flash this.Success("Type de viking supprimé avec succès."); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Libelle")] TypeViking typeViking) { if (ModelState.IsValid) { TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db); typeVikingFactory.Update(ref typeViking); // Ajout d'un message flash this.Success("Type de viking edité avec succès."); return(RedirectToAction("Index")); } return(View(typeViking)); }
// GET: TypeViking/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db); TypeViking typeViking = typeVikingFactory.GetById(id.Value); if (typeViking == null) { return(HttpNotFound()); } return(View(typeViking)); }
// GET: TypeViking/Create public ActionResult Create() { TypeViking typeViking = new TypeViking(); return(View(typeViking)); }