Exemplo n.º 1
0
        public ActionResult GetClienteList(string criterio)
        {
            try
            {
                ClientesBS       BS         = new ClientesBS();
                List <ClienteVO> dataSource = BS.GetClienteList(criterio);

                return(Json(dataSource));
            }
            catch (Exception ex)
            {
                return(Json(ParseException(new CCExcepcion(ex))));
            }
        }
Exemplo n.º 2
0
        public ActionResult GetClienteGrid(BaseGridVO filtro)
        {
            try
            {
                if (filtro.orderby == null || filtro.orderby == string.Empty)
                {
                    filtro.orderby = "clave";
                }

                if (filtro.ordertype == null || filtro.ordertype == string.Empty)
                {
                    filtro.ordertype = "asc";
                }

                filtro.porpagina = 10;
                filtro.realPath  = Server.MapPath("~/XmlGrids/" + filtro.xmlgrid + ".xml");


                ClientesBS       BS         = new ClientesBS();
                List <ClienteVO> dataSource = BS.GetClienteList(filtro);

                int total = 0;
                if (dataSource.Count > 0)
                {
                    total = dataSource[0].total;
                }

                List <object> listaGrid = dataSource.ToList <object>();
                listaGrid.Add(total);

                LazyLoadDatagrid lazyGrid = new LazyLoadDatagrid();
                lazyGrid.regresaLazyLoadDatagrid(filtro.realPath, filtro.objJavascript, listaGrid);

                return(Content(lazyGrid.stbHtml.ToString()));
            }
            catch (Exception ex)
            {
                return(Json(ParseException(new CCExcepcion(ex))));
            }
        }