private string StrWhere(BaseParametersSearch condition) { string where = string.Empty; if (!string.IsNullOrWhiteSpace(condition.keyword)) { where += string.Format(" and (ParametersKey like '%{0}%' or NickName like '%{0}%' or Remark like '%{0}%' or Type like '%{0}%')", condition.keyword); } return(where); }
public ActionResult GetPage(BaseParametersSearch condition) { string where = StrWhere(condition); PageJsonModel <BaseParameters> page = new PageJsonModel <BaseParameters>(); page.pageIndex = condition.pageIndex; page.pageSize = condition.pageSize; page.strForm = " BaseParameters "; page.strSelect = " * "; page.strWhere = where; page.strOrder = "Type,Sort"; page.LoadList(); return(Json(page.pageResponse, JsonRequestBehavior.AllowGet)); }