public HttpResponseMessage getme(SearchCondition model) { int em = 0; DAL.Implement.MemberDal.SearchCondition sc = new MemberDal.SearchCondition(); sc.address = model.address; sc.aftersales = model.aftersales; sc.city = model.city; sc.classx = model.classx; sc.country = model.country; sc.field = model.field; sc.flag = model.flag; sc.keyword = model.keyword; sc.memo = model.memo; sc.province = model.province; sc.size = model.size < 30 ? model.size : 30; sc.start = model.start; sc.tracktype = model.tracktype; string[] kstr = model.keyword.ToString().Split(','); sc.keywords = kstr; string str = "[]"; if (ValidateSign(Regex.Replace(model.keyword, ",", string.Empty), model.flag, model.field, Convert.ToDateTime(model.timestamp), model.sign)) { str = _dal.GetList(sc, out em).Replace("\r", string.Empty).Replace("\n", string.Empty); } //str = _dal.GetList(sc, out em).Replace("\r", string.Empty).Replace("\n", string.Empty); //string str = _dal.GetList(sc, out em); HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json") }; return result; }
public HttpResponseMessage getCount(SearchCondition model) { DAL.Implement.MemberDal.SearchCondition sc = new MemberDal.SearchCondition(); sc.address = model.address; sc.aftersales = model.aftersales; sc.city = model.city; sc.classx = model.classx; sc.country = model.country; sc.field = model.field; sc.flag = model.flag; sc.keyword = model.keyword; sc.memo = model.memo; sc.province = model.province; sc.tracktype = model.tracktype; int str = 0; if (ValidateSign(model.keyword, model.flag, model.field,Convert.ToDateTime(model.timestamp),model.sign)) { str = _dal.GetCount(sc); } //int str = _dal.GetCount(sc); HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(str.ToString(), Encoding.GetEncoding("UTF-8"), "application/json") }; return result; }