public string DeleteBlockedPeople(BlockedPeople blockedPeople) { bool success = GlobalVariables.databaseConnection.DeleteBlockedPeople(blockedPeople); if (success) { return(string.Empty); } else { return(English.SomethingWentWrong()); } }
public bool DeleteBlockedPeople(BlockedPeople blockedPeople) { var message = Segédfüggvények.Delete("Blockedpeople/DeleteBlockedUser", blockedPeople); if (message.StatusCode == System.Net.HttpStatusCode.OK) { return(true); } else { return(false); } }
public bool InsertBlockedPeople(BlockedPeople blockedPeople) { var message = Segédfüggvények.PostPut(HttpMethod.Post, blockedPeople, "Blockedpeople/InsertBlockeduser"); if (message.StatusCode == System.Net.HttpStatusCode.OK) { return(true); } else { return(false); } }
public async Task <bool> BlockUser(Guid blockingUserId, Guid userIdtoBlock) { var blockedPeople = new BlockedPeople(blockingUserId, userIdtoBlock); //check if already blocked var isAlreadyExists = await _userRepository.AnyAsync(w => w.UsersBlockedByUser.Any(x => x.BlockingUserId == blockingUserId && x.BlockedUserId == userIdtoBlock)); if (isAlreadyExists) { return(true); } var blockingUser = await _userRepository.GetByIdAsync(blockingUserId); if (blockingUser == null) { blockingUser = new User(blockingUserId); await _userRepository.AddAsync(blockingUser); await _userRepository.UnitOfWork.CommitAsync(); } var isBlockedUserExists = await _userRepository.AnyAsync(w => w.Id == userIdtoBlock); if (isBlockedUserExists == false) { var blockedUser = new User(userIdtoBlock); await _userRepository.AddAsync(blockedUser); await _userRepository.UnitOfWork.CommitAsync(); } blockingUser.UsersBlockedByUser.Add(blockedPeople); await _userRepository.UpdateAsync(blockingUser); return(await _userRepository.UnitOfWork.CommitAsync()); }
public string InsertBlockedPeople(BlockedPeople blockedPeople) { // kész - homepage-ről például kiszedni // kész - ahol csak profilkép van onnan nem kell, csak a profil oldalakrol // kész - ellenőrzés a hashtagnél is hogy olyanokat ne jelenítsen meg, // ami blokkolt usertől van, illetve amikor rákeresünk egy hashtegre // ott se jelenítse meg azokat //Itt majd ki kell kötni, hogy amíg van olyan pet, amit tőle követsz nem blokkolhatod. if (true) { bool success = GlobalVariables.databaseConnection.InsertBlockedPeople(blockedPeople); if (success) { return(string.Empty); } else { return(English.SomethingWentWrong()); } } }