コード例 #1
0
        public static bool FromDBTable(this UserPermissionData item, DataRow row)
        {
            if (row == null)
            {
                return(false);
            }

            row.Copy(item);
            return(true);
        }
コード例 #2
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);
        }