public ActionResult DeleteCustomer(short Id) { using (DataBase4VidlyEntities context = new DataBase4VidlyEntities()) { var client = context.Clients.SingleOrDefault(c => c.Id == Id); context.Clients.Remove(client); context.SaveChanges(); return(View("Index")); }; }
public ActionResult DeleteMovie(short Id) { using (DataBase4VidlyEntities context = new DataBase4VidlyEntities()) { var film = context.Films.SingleOrDefault(c => c.Id == Id); context.Films.Remove(film); context.SaveChanges(); return(View("Index")); }; }
public ActionResult Creator(string Titre, string Genre) { using (DataBase4VidlyEntities context = new DataBase4VidlyEntities()) { var LastFilm = context.Films.OrderByDescending(o => o.Id).FirstOrDefault(); var LastIdFilm = LastFilm.Id; var NextId = LastIdFilm + 1; var Fl = new Film() { Id = NextId, Titre = Titre, Genre = Genre }; context.Films.Add(Fl); context.SaveChanges(); return(View("Index")); }; }