Beispiel #1
0
        /// <summary>
        /// 获取学校数据
        /// </summary>
        /// <returns></returns>
        public string GetSchoolList()
        {
            List <object> Ret = new List <object>();

            try
            {
                string sql = "SELECT row_number() over (order by CreateTime DESC) as rowid, * FROM Z_School ";

                DBOperation db = new DBOperation();
                DataSet     ds = new DataSet();
                ds = db.GetDataSet(sql);
                //保存数据表并返回
                Ret.Add(ds);

                return("{\"result\":\"success\",\"list\":" + ToJosn.wxListToJson(Ret) + "}");
            }
            catch (Exception ex)
            {
                Ret.Add("state:0,msg:获取数据错误!");
                return(ToJosn.wxListToJson(Ret));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 分页数据
        /// 页面权限信息
        /// </summary>
        /// <param name="title">页面权限名称</param>
        /// <returns></returns>
        public string Select_Role_Page(string title)
        {
            List <object> Ret = new List <object>();

            try
            {
                string sql = "SELECT row_number() over (order by EditDate DESC) as rowid, * FROM Z_Role WHERE Del = '0' AND Title LIKE '%" + title + "%'";

                DBOperation db = new DBOperation();
                DataSet     ds = new DataSet();
                ds = db.GetDataSet(sql);
                //保存数据表并返回
                Ret.Add(ds);

                return("{\"result\":\"success\",\"list\":" + ToJosn.wxListToJson(Ret) + "}");
            }
            catch (Exception ex)
            {
                Ret.Add("state:0,msg:获取数据错误!");
                return(ToJosn.wxListToJson(Ret));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 获取角色下的用户
        /// </summary>
        /// <param name="title">页面权限名称</param>
        /// <returns></returns>
        public string get_role_user_list(string id)
        {
            List <object> Ret = new List <object>();

            try
            {
                string sql = "select * from Z_User ";
                sql = sql + " where PageRole_ID='" + id + "' ";

                DBOperation db = new DBOperation();
                DataSet     ds = new DataSet();
                ds = db.GetDataSet(sql);
                //保存数据表并返回
                // Ret.Add(ds);

                return("{\"result\":\"success\",\"id\":\"" + id + "\",\"list\":" + JsonHelper.ToJson(ds) + "}");
            }
            catch (Exception ex)
            {
                Ret.Add("state:0,msg:获取数据错误!");
                return(ToJosn.wxListToJson(Ret));
            }
        }
Beispiel #4
0
        public string GetSchoolBySchoolId(string SchoolId)
        {
            List <object> Ret = new List <object>();

            try
            {
                string sql = " ";
                sql = sql + " select * from Z_School ";
                sql = sql + " where RecordId = '" + SchoolId + "'";

                DBOperation db = new DBOperation();
                DataSet     ds = new DataSet();
                ds = db.GetDataSet(sql);
                //保存数据表并返回
                Ret.Add(ds);

                return("{\"result\":\"success\",\"list\":" + ToJosn.wxListToJson(Ret) + "}");
            }
            catch (Exception ex)
            {
                Ret.Add("state:0,msg:获取数据错误!");
                return(ToJosn.wxListToJson(Ret));
            }
        }
Beispiel #5
0
        /// <summary>
        /// 分页数据
        /// 页面权限信息
        /// </summary>
        /// <param name="title">页面权限名称</param>
        /// <returns></returns>
        public string get_role_user()
        {
            List <object> Ret = new List <object>();

            try
            {
                string sql = "select Z_Role.* ,(select count(*) from Z_User ";
                sql = sql + " where Z_Role.ID=Z_User.PageRole_ID) as usercount ";
                sql = sql + " FROM Z_Role WHERE Del = '0'";

                DBOperation db = new DBOperation();
                DataSet     ds = new DataSet();
                ds = db.GetDataSet(sql);
                //保存数据表并返回
                Ret.Add(ds);

                return("{\"result\":\"success\",\"list\":" + ToJosn.wxListToJson(Ret) + "}");
            }
            catch (Exception ex)
            {
                Ret.Add("state:0,msg:获取数据错误!");
                return(ToJosn.wxListToJson(Ret));
            }
        }