コード例 #1
0
ファイル: FrontComment.cs プロジェクト: bpeck81/Cloudclub_v1
        public FrontComment(ClubRequest clubRequest, Account authorAccount, bool isMember)
        {
            IsMember = isMember;
            ClubRequestBool = true;
            ClubId = clubRequest.ClubId;
            ClubRequestText = clubRequest.Text;
            ClubRequestUsername = authorAccount.Username;
            ClubRequestInstance = clubRequest;


        }
コード例 #2
0
ファイル: DBWrapper.cs プロジェクト: bpeck81/Cloudclub_v1
        /// create a request to join a club; returns true if success, false if the user has already requested to join
        /// TODO: im making it as though a single user votes, but how is it accepted or rejected?f
        public async Task<bool> CreateClubRequest(string text, string clubId)
        {
            var list = await clubRequestTable.Where(item => item.AccountId == User.Id && item.ClubId == clubId).ToListAsync();

            if (list.Count > 0)
            {
                return false;
            }
            else
            {
                ClubRequest clubRequest = new ClubRequest(User.Id, clubId, text);
                await clubRequestTable.InsertAsync(clubRequest);

                return true;
            }
        }