コード例 #1
0
 public static UserPermission[] FindPermissionsByType(ISession session, UserPermissionTypes type)
 {
     return(session.Query <UserPermission>()
            .Where(p => p.Type == type)
            .OrderBy(p => p.OrderIndex).ThenBy(p => p.Name)
            .ToArray());
 }
コード例 #2
0
        public static async Task <UserPermissionData[]> FromDBByPermissionTypeAsync(UserPermissionTypes permissionType)
        {
            var query = new DBQuery_User_Permission_Select_By_PermissionType();

            query.IN.PermissionType = permissionType;
            var result = await DBThread.Instance.ReqQueryAsync(query);

            return(query.OUT.Items.ToArray());
        }
コード例 #3
0
        public static async Task <bool> FromDBAsync(this UserPermissionData item
                                                    , DBKey userId, UserPermissionTypes permissionType)
        {
            var query = new DBQuery_User_Permission_Select();

            query.IN.UserId         = userId;
            query.IN.PermissionType = permissionType;
            var result = await DBThread.Instance.ReqQueryAsync(query);

            var permissionData = query.OUT.Items.Find(permissionType);

            if (permissionData != null)
            {
                permissionData.Copy(item);
                return(true);
            }
            return(false);
        }
コード例 #4
0
 public UserInfo(UserPermissionTypes permission, string name, string password)
 {
     Permission = permission;
     Name = name;
     Password = password;
 }