public ActionResult Index() { if (Session["username"] == null) { return(RedirectToAction("../Login/Index")); } return(View(LocationDAO.FindAll())); }
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) { LocationDAO.Delete(Id); } return(View("Index", LocationDAO.FindAll())); }
public ActionResult InsertLocation(Location location, string creationDate, int[] IdMovies) { if (Session["username"] == null) { return(RedirectToAction("../Login/Index")); } if (IdMovies == null) { ModelState.AddModelError("", "Nenhum filme foi selecionado para cadastrar"); } if (ModelState.IsValid) { LocationDAO.Insert(location, creationDate, IdMovies); return(View("Index", LocationDAO.FindAll())); } return(View("Insert", GetNewLocation())); }