Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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()));
        }
Exemple #3
0
 public void RemoveMovie(int id)
 {
     _movieDAO.Delete(id);
 }