Exemplo n.º 1
0
        public string GetUserList(int page, int rows)
        {
            DataTable dt    = db.AccessReader("select top " + rows + " * from Users where IsDel=0 and ID not in (select top " + (page - 1) * rows + 1 + " ID from Users where IsDel=0 order by ID asc)");
            int       count = Convert.ToInt32(db.AccessScaler("select count(*) from Users where IsDel=0")) - 1;
            string    json  = "{\"total\":\"" + count + "\",\"rows\":[";

            foreach (DataRow dr in dt.Rows)
            {
                json += "{\"ID\":\"" + dr["ID"] + "\",\"school\":\"" + dr["School"] + "\",\"class\":\"" + dr["Class"] + "\",\"Name\":\"" + dr["Name"] + "\",\"StudentId\":\"" + dr["StudentId"] + "\",\"Sex\":\"" + dr["Sex"] + "\",\"BirthDate\":\"" + dr["BirthDate"] + "\",\"Address\":\"" + dr["Address"] + "\",\"SubmitDate\":\"" + dr["SubmitDate"] + "\",\"SuccessDate\":\"" + dr["SuccessDate"] + "\",\"GraduationDate\":\"" + dr["GraduationDate"] + "\",\"Absorption\":\"" + dr["Absorption"] + "\",\"Positive\":\"" + dr["Positive"] + "\",\"image\":\"/Themes/Update/Images/" + dr["h_Image"] + "\",\"append\":\"" + dr["Append"] + "\"},";
            }
            json = json.Substring(0, json.Length - 1) + "]}";
            return(json);
        }