public IActionResult Home()
 {
     try
     {
         MovieList = MovieDAObj.GetMovies();
         int logged = Convert.ToInt32(HttpContext.Session.GetInt32("Logged"));
         ViewData["message"] = logged;
         return(View(MovieList));
     }
     catch (Exception exUserHome)
     {
         string exMessage = "oops! There is a problem in loading the home page.";
         return(RedirectToAction("Index", "ExeptionHandler", new { Exeption = exMessage }));
     }
 }
Ejemplo n.º 2
0
 public IActionResult MovieList(string message)
 {
     try
     {
         int admin = Convert.ToInt32(HttpContext.Session.GetInt32("Admin"));
         if (admin == 1)
         {
             List <MovieInfo> movies     = new List <MovieInfo>();
             MovieDA          MovieDAObj = new MovieDA();
             movies          = MovieDAObj.GetMovies();
             ViewBag.message = message;
             return(View(movies));
         }
         else
         {
             return(RedirectToAction("Home", "Movie"));
         }
     }
     catch (Exception exRemoveShow)
     {
         string exMessage = "oops! There is a problem in loading the page.";
         return(RedirectToAction("Index", "ExeptionHandler", new { Exeption = exMessage }));
     }
 }