Esempio n. 1
0
        public ActionResult CustomerPage(DataTablesPageRequest pageRequest)
        {
            var petaPocoPage = _repository.GetCustomers(pageRequest);
            var pageResponse = DataTablesFormat.PageResponse(pageRequest, petaPocoPage);

            return Json(pageResponse);
        }
Esempio n. 2
0
 public static object PageResponse(DataTablesPageRequest pageRequest, Page<Customer> report)
 {
     return new
            	{
            		sEcho = pageRequest.Echo,
            		iTotalRecords = report.TotalItems,
            		iTotalDisplayRecords = report.TotalItems,
            		sColumns = pageRequest.ColumnNames,
            		aaData = (from i in report.Items
            		          select new[]
            		                 	{
            		                 		i.Id.ToString(CultureInfo.InvariantCulture),
            		                 		i.Last,
            		                 		i.First,
            		                 		i.Street,
            		                 		i.City,
            		                 		i.State,
            		                 		i.Zip,
            		                 		i.Phone,
            		                 		i.Email
            		                 	}).ToList()
            	};
 }