示例#1
0
        public ActionResult Listar(GridDataRequest request)
        {
            int totalRecords = 0;
            var lstGrd       = ArticuloBL.LstListaArticulosJGrid(request, ref totalRecords);

            var productsData = new
            {
                total   = (int)Math.Ceiling((float)totalRecords / (float)request.rows),
                page    = request.page,
                records = totalRecords,
                rows    = (from item in lstGrd
                           select new
                {
                    id = item.ArticuloId,
                    cell = new string[] {
                        item.ArticuloId.ToString(),
                        item.ListaPrecioId.ToString(),
                        item.TipoArticulo,
                        item.ArticuloDesc,
                        item.PuntosCanje.ToString(),
                        item.Estado.ToString(),
                        item.ListaPrecioId.ToString() + "," + (item.Estado ? "1":"0")
                    }
                }
                           ).ToArray()
            };

            return(Json(productsData, JsonRequestBehavior.AllowGet));
        }