Пример #1
0
        //获取角色
        public static DataTable GetRoleFromMaster(int masterid)
        {
            Query q = RoleMaster.Query();

            q.AddWhere(RoleMaster.Columns.MasterId, masterid);
            return(q.ExecuteDataSet().Tables[0]);
        }
Пример #2
0
        //删除角色
        public static void DelRoles(int masterid, int roleid)
        {
            Query q = RoleMaster.Query();

            q.AddWhere(RoleMaster.Columns.MasterId, masterid);
            q.AddWhere(RoleMaster.Columns.RoleId, roleid);
            q.QueryType = QueryType.Delete;
            q.Execute();
        }
Пример #3
0
        public static void UpdateRoleMasters(int masterid)
        {
            Query q = RoleMaster.Query();

            q.AddWhere(RoleMaster.Columns.MasterId, masterid);
            q.AddUpdateSetting(RoleMaster.Columns.IsPass, 1);
            q.QueryType = QueryType.Update;
            q.Execute();
        }
Пример #4
0
        //删除角色及对应的操作、用户
        public static void DelRole(int id)
        {
            Query q = RoleMaster.Query();

            q.AddWhere(RoleMaster.Columns.RoleId, id);
            q.QueryType = QueryType.Delete;
            q.Execute();
            Query s = OpProRole.Query();

            s.AddWhere(OpProRole.Columns.RoleId, id);
            s.QueryType = QueryType.Delete;
            s.Execute();
            Role.Delete(id);
        }
Пример #5
0
        //角色是否存在
        public static bool isRoleMaster(int masterid)
        {
            Query q = RoleMaster.Query();

            q.AddWhere(RoleMaster.Columns.MasterId, masterid);
            DataTable dt = q.ExecuteDataSet().Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }