public virtual ActionResult Editar(int id)
        {
            var filme           = TMovie.Load(id);
            var categoriasFilme = filme.TMovieCategories.Select(x => x.Category.Id).ToList();

            ViewBag.EnumFormatMovie = EnumHelper.ListAll <FormatMovie>().ToSelectList(x => x, x => x.Description());
            ViewBag.EnumTypeMovie   = EnumHelper.ListAll <TypeMovie>().ToSelectList(x => x, x => x.Description());
            ViewBag.Category        = TCategory.List(x => !categoriasFilme.Contains(x.Id)).ToSelectList(x => x.Id, x => x.Name);
            return(View(filme));
        }
 public void SaveIten(TReservation model)
 {
     TIten.Delete(x => x.Movie.Id == model.Id);
     if (model.Iten != null)
     {
         for (int i = 0; i < model.itensdareserva.Length; i++)
         {
             new TIten()
             {
                 Reservation = model,
                 Movie       = TMovie.Load(model.itensdareserva[i])
             }.Save();
         }
     }
 }
Exemple #3
0
        public void SaveMovies(TReservation model)
        {
            TIten.Delete(x => x.Reservation.Id == model.Id);

            if (model.Movies != null)
            {
                for (int i = 0; i < model.Movies.Length; i++)
                {
                    var movie = TMovie.Load(model.Movies[i]);
                    new TIten()
                    {
                        Reservation = model,
                        Movie       = movie,
                        Value       = movie.Value.Value,
                        Quantity    = model.Quantities[i]
                    }.Save();
                }
            }
        }
        public virtual ActionResult Excluir(int id)
        {
            var filme = TMovie.Load(id);

            return(PartialView("_excluir", filme));
        }
        public virtual ActionResult ListarFilmes(int id)
        {
            var filmes = TMovie.Load(id);

            return(PartialView("_listar-filmes", filmes));
        }