Ejemplo n.º 1
0
        public virtual ActionResult Reservar()
        {
            var reserva = new TReservation();

            ViewBag.Movie = TMovie.ListAll().ToSelectList(x => x.Id, x => x.Name);
            return(View(reserva));
        }
Ejemplo n.º 2
0
        public virtual ActionResult Editar(int id)
        {
            var itens = new TIten();

            ViewBag.Reservation = TReservation.ListAll().ToSelectList(x => x.Id, x => x.Id);
            ViewBag.Movie       = TMovie.ListAll().ToSelectList(x => x.Id, x => x.Id);
            return(View());
        }
Ejemplo n.º 3
0
        public virtual ActionResult Cadastrar()
        {
            var reserva = new TReservation();

            ViewBag.Client = TClient.ListAll().ToSelectList(x => x.Id, x => x.Name);
            ViewBag.Iten   = TMovie.ListAll().ToSelectList(x => x.Id, x => x.Name);
            return(View(reserva));
        }
Ejemplo n.º 4
0
        public virtual ActionResult Editar(int id)
        {
            var reserva = TReservation.Load(id);

            ViewBag.Client = TClient.ListAll().ToSelectList(x => x.Id, x => x.Name);
            ViewBag.Iten   = TMovie.ListAll().ToSelectList(x => x.Id, x => x.Name);
            ViewBag.Sale   = TSale.ListAll().ToSelectList(x => x.Id, x => x.EnumStatusSale);
            return(View(reserva));
        }
Ejemplo n.º 5
0
 public virtual ActionResult Editar(TIten model)
 {
     try
     {
         TempData["Alert"] = new Alert("success", "Seu item foi editado com sucesso");
         model.Save();
         return(RedirectToAction("Index"));
     }
     catch (SimpleValidationException ex)
     {
         ViewBag.Reservation = TReservation.ListAll().ToSelectList(x => x.Id, x => x.Id);
         ViewBag.Movie       = TMovie.ListAll().ToSelectList(x => x.Id, x => x.Id);
         return(HandleViewException(model, ex));
     }
 }
Ejemplo n.º 6
0
        public virtual ActionResult cliente_filmes()
        {
            List <TMovie> filmes;
            var           client       = (TClient)ViewBag.Cliente;
            var           preferencias = client.TPreferences.Select(x => x.Category.Id).ToList();

            if (preferencias.Count != 0)
            {
                filmes = TMovieCategory.List(x => preferencias.Contains(x.Category.Id)).Select(x => x.Movie).ToList();
            }
            else
            {
                filmes = TMovie.ListAll().ToList();
            }
            return(View(filmes));
        }
Ejemplo n.º 7
0
        public virtual ActionResult Index()
        {
            var filmes = TMovie.ListAll().ToList();

            return(View(filmes));
            //var filmes2 = TMovieCategory.List(x => x.Category.Id == 5).Select(x => x.Movie);
            //TClient.List(x => x.Name == "Pedro");
            //TClient.List(x => x.Name.StartsWith("m"));
            //TClient.List(x => x.Name.EndsWith("l"));
            //TClient.List(x => x.Name.Contains("silva"));
            //TReservation.List(x => x.Client.Name.StartsWith("p"));
            //TUser.Delete(x => x.Name.EndsWith("u"));
            //TClient.Delete(x => x.Name.StartsWith("pedro") || x.Name.EndsWith("silva"));
            //TClient.List(x => Name.StartsWith("Maria") && Name.EndsWith("João"));
            //TReservation.Delete(x => x.Client.Id == cliente.Id);
            //TPreference.Delete(x => x.Client.Name.Contains("João"));
            //TMovie.List(x => x.IsActive != false && x.Stock > 0);
        }
Ejemplo n.º 8
0
        public virtual ActionResult Index()
        {
            var filmes = TMovie.ListAll().ToList();

            return(View(filmes));
        }