/// <summary> /// 辅助检索 /// </summary> private string ConvertQuery(SearhOrg seachOrg, List <MySqlParameter> list) { StringBuilder whereClause = new StringBuilder(); if (seachOrg == null) { return(""); } //搜索条件 if (!string.IsNullOrEmpty(seachOrg.KeyWord)) { whereClause.Append(" AND ( o.LInkMan LIKE CONCAT('%', @str, '%') or o. OrgName LIKE CONCAT('%', @str, '%') or o. LinkTel LIKE CONCAT('%', @str, '%') )");//账号和姓名加上电话 //list.Add(DBHelper.AddParameterWithValue("@str", searhOrg.KeyWord)); list.Add(new MySqlParameter("@str", seachOrg.KeyWord)); } return(whereClause.ToString()); }
// GET: Data //public ActionResult Index() //{ // return View(); //} /// <summary> /// 获取列表信息 /// </summary> /// <returns></returns> public JsonResult GetOrgsList() { string data = Request["data"] ?? string.Empty; SearhOrg serPre = new SearhOrg(); //JsonConvert.DeserializeObject<SearhOrg>(data); serPre.KeyWord = Server.UrlDecode(data); ManagePara <SearhOrg> paraList = new ManagePara <SearhOrg>();//参数类初始化 paraList.Para = serPre; paraList.PageIndex = Convert.ToInt32(Request["currentPage"] ?? (1).ToString());//接收分页参数 paraList.PageSize = Convert.ToInt32(Request.Form.Get("pageSize") ?? (10).ToString()); ManageResponse <List <Org> > response = newsBll.GetOrgsList(paraList); response.TagValue = paraList.PageIndex.ToString(); JsonResult json = new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; return(json); }