コード例 #1
0
        // GET: Articulo/Filtrar/5
        ////////////////

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


            //articuloAsembler.covert
            ViewData["controller"] = System.Web.HttpContext.Current.Session["controller"] as String;
            ViewData["action"]     = System.Web.HttpContext.Current.Session["action"] as String;
            ViewData["arg"]        = System.Web.HttpContext.Current.Session["arg"];
            return(View(res));
        }
コード例 #2
0
        public ActionResult Filtrar(FiltroEvento collection)
        {
            try
            {
                EventoCEN        cen = new EventoCEN();
                IList <EventoEN> res = null, aux = null;
                // TODO: Add delete logic here
                res = cen.ReadAll(0, int.MaxValue);

                if (!(collection.Preciobol == false || collection.Preciomin <= 0 || collection.Preciomax <= 0 || collection.Preciomax <= collection.Preciomin))
                {
                    aux = cen.Filtroprecio(collection.Preciomin, collection.Preciomax);
                    res = res.Intersect(aux).ToList();
                }
                if (collection.Nombrebol == true && collection.Nombre != null)
                {
                    aux = cen.Filtronombre(collection.Nombre);
                    res = res.Intersect(aux).ToList();
                }
                if (collection.Tipobol == true && collection.Tipo != null)
                {
                    aux = cen.Filtrotipo(collection.Tipo);
                    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();
                }
                AssemblerEvento ass     = new AssemblerEvento();
                IList <Evento>  listart = ass.ConvertListENToModel(res);

                System.Web.HttpContext.Current.Session["resu"] = listart;
                return(RedirectToAction("Resultadobusqueda", "Evento", null));
            }
            catch
            {
                return(View());
            }
        }