예제 #1
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getUserList(HttpContext context)
        {
            Json      jsonResult = new Json();
            string    username   = context.Request["username"];
            string    id         = context.Request["id"];
            string    limit      = context.Request["limit"];
            string    page       = context.Request["page"];
            DataTable dt         = ms.getUserList(id, username, limit, page);
            int       count      = ms.getUserListNum(id, username);

            if (dt == null)
            {
                jsonResult.Success = false;
                jsonResult.count   = count;
                jsonResult.code    = 400;
            }
            else
            {
                jsonResult.Success = true;
                jsonResult.data    = dt;
                jsonResult.count   = count;
                jsonResult.code    = 0;
            }
            string strJson = JsonConvert.SerializeObject(jsonResult);

            return(strJson);
        }