Beispiel #1
0
        //[RequireHttps]
        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);
        }
Beispiel #2
0
        //[RequireHttps]
        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 str = "[]";

            if (ValidateSign(model.keyword, model.flag, model.field, Convert.ToDateTime(model.timestamp), model.sign))
            {
                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);
        }