private void DeleteOperation() { long id = -1; while (id < 0) { id = view.EnterId(); } if (id < 0) { throw new Exception("Wrong id"); } switch (view.entity) { case Entity.Movie: movieDAO.Delete(id); break; case Entity.Seance: seanceDAO.Delete(id); break; case Entity.Ticket: ticketDAO.Delete(id); break; } }
public ActionResult Delete(int[] Id) { if (Session["username"] == null) { return(RedirectToAction("../Login/Index")); } if (Id == null) { ModelState.AddModelError("", "Nenhum item foi selecionado para deletar"); } if (ModelState.IsValid) { MovieDAO.Delete(Id); } return(View("Index", MovieDAO.FindAll())); }
public void RemoveMovie(int id) { _movieDAO.Delete(id); }