public ActionResult EditVille(Entity.Ville value) { ViewBag.Title = "Edit Ville"; ViewBag.postInfo = "Ville saved successfuly"; ViewBag.postInfoClass = "alert-success"; Console.WriteLine(value.Id + ";" + value.Name + ";" + value.Description); using (var dao = new Dao.Dao()) { if (!ModelState.IsValid) { return(View(value)); } dao.UpdateVille(value); return(View("Saved")); } }
public Entity.Ville InsertVille(Entity.Ville v) { v = Context.Villes.Add(v); Context.SaveChanges(); return(v); }
public Entity.Ville UpdateVille(Entity.Ville c) { Context.Villes.AddOrUpdate(c); Context.SaveChanges(); return(c); }