Exemplo n.º 1
0
        // GET: Articulo/Filtrar/5
        ////////////////

        public ActionResult Filtrar()
        {
            FiltroPelicula res = new FiltroPelicula();


            //articuloAsembler.covert
            return(View(res));
        }
Exemplo n.º 2
0
        public ActionResult Filtrar(FiltroPelicula collection)
        {
            try
            {
                PeliculaCEN        cen = new PeliculaCEN();
                IList <PeliculaEN> res = null, aux = null;
                // TODO: Add delete logic here
                res = cen.ReadAll(0, int.MaxValue);


                if (!(collection.anyobol == false || collection.anyomin <= 0 || collection.anyomax <= 0 || collection.anyomax <= collection.anyomin))
                {
                    aux = cen.Filtroanyo(collection.anyomin, collection.anyomax);
                    res = res.Intersect(aux).ToList();
                }
                if (collection.Nombrebol == true && collection.Nombre != null)
                {
                    aux = cen.Filtronombre(collection.Nombre);
                    res = res.Intersect(aux).ToList();
                }
                if (collection.generobol == true && collection.genero != null)
                {
                    aux = cen.Filtrogenero(collection.genero);
                    res = res.Intersect(aux).ToList();
                }

                if (collection.Valoracionbol == true && collection.Valoracion > 0 && collection.Valoracion < 6)
                {
                    aux = cen.Filtrovalor((SMPGenNHibernate.Enumerated.SMP.ValoracionEnum)collection.Valoracion);
                    res = res.Intersect(aux).ToList();
                }



                AssemblerPelicula ass     = new AssemblerPelicula();
                IList <Pelicula>  listart = ass.ConvertListENToModel(res);

                System.Web.HttpContext.Current.Session["resu"] = listart;

                return(RedirectToAction("Resultadobusqueda", "Pelicula", null));
            }
            catch
            {
                return(View());
            }
        }