public IEnumerable <CustomerModel> GetCustomers(GridModel model) { var custs = _customer.GetCustomers(model); if (model.param.order.Count > 0) { foreach (var item in model.param.order) { if (item.dir == "asc") { switch (item.column) { case 1: custs = custs.OrderBy(x => x.Id); break; case 2: break; default: break; } } else { } } } return(custs); }
// GET: CustomerINFO public ActionResult Index() { CustomerClass custcls = new CustomerClass(); List<Customer> cust = custcls.GetCustomers(); return View(cust); }