Exemplo n.º 1
0
        // GET: Articulo
        public ActionResult Index()
        {
            EventoCEN        cen     = new EventoCEN();
            IList <EventoEN> enlinst = cen.ReadAll(0, int.MaxValue);
            AssemblerEvento  ass     = new AssemblerEvento();
            IList <Evento>   listart = ass.ConvertListENToModel(enlinst);

            //articuloAsembler.covert

            System.Web.HttpContext.Current.Session["controller"] = "Evento";
            System.Web.HttpContext.Current.Session["action"]     = "Index";
            System.Web.HttpContext.Current.Session["arg"]        = null;
            return(View(listart));
        }
Exemplo n.º 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());
            }
        }