public JsonResult GetSysList() { var input = new VSysInfoListCondition(); var limit = 0; int.TryParse(Request.Form["limit"], out limit); input.limit = limit; var offSet = 0; int.TryParse(Request.Form["offset"], out offSet); input.offset = offSet; input.sysName = Request.Form["sysName"]; input.sysType = Request.Form["sysType"]; return(Json(service.GetSysInfoPage(input))); }
/// <summary> /// 获取系统信息分页列表 /// </summary> /// <param name="input"></param> /// <returns></returns> public VPageBootstrapTable <SysInfo> GetSysInfoPage(VSysInfoListCondition input) { var list = repoSys.GetList(); if (!string.IsNullOrEmpty(input.sysName)) { list = list.Where(w => w.SysName.Contains(input.sysName)); } if (!string.IsNullOrEmpty(input.sysType)) { list = list.Where(w => w.SysType == input.sysType); } var rows = list.OrderByDescending(o => o.SysOrder).Skip(input.offset).Take(input.limit).ToList(); var total = list.Count(); return(new VPageBootstrapTable <SysInfo> { rows = rows, total = total }); }