Esempio n. 1
0
        public IActionResult Index(ModAddModel model)
        {
            if (ModelState.IsValid)
            {
                MovieOnDemand movie = new MovieOnDemand
                {
                    Movie     = model.Movie,
                    MovieTime = model.MovieTime,
                    Status    = _statusService.GetByName("Pending"),
                    Customer  = _cusService.GetByUser(_userManager.GetUserId(HttpContext.User))
                };
                _modservice.Add(movie);

                ViewBag.success = "success";
                ViewBag.msg     = "Your Request Has been send to Admin, Thank You";

                ModelState.Clear();
                return(View());
            }
            return(View(model));
        }
Esempio n. 2
0
 public void Add(MovieOnDemand newMovie)
 {
     _con.MoviesOnDemand.Add(newMovie);
     _con.SaveChanges();
 }