예제 #1
0
 public AccountController(AccountManager accountManager,
                          IFileService fileService,
                          StatsManager statsManager,
                          AccountFriendManager accountFriendManager,
                          FriendRequestManager friendRequestManager,
                          DataContext dataContext,
                          SessionManager sessionManager,
                          AccountItemManager accountItemManager,
                          ShopItemManager shopItemManager,
                          IImageProcessingService imageProcessingService,
                          FileManager fileManager,
                          IOptions <FileOptions> options, JwtTokenGenerator tokenGenerator, NotificationManager notificationManager)
 {
     _accountManager         = accountManager;
     _fileService            = fileService;
     _statsManager           = statsManager;
     _accountFriendManager   = accountFriendManager;
     _friendRequestManager   = friendRequestManager;
     _dataContext            = dataContext;
     _sessionManager         = sessionManager;
     _accountItemManager     = accountItemManager;
     _shopItemManager        = shopItemManager;
     _imageProcessingService = imageProcessingService;
     _fileManager            = fileManager;
     _tokenGenerator         = tokenGenerator;
     _notificationManager    = notificationManager;
     _options = options.Value;
 }
예제 #2
0
        public UserProfileController()
        {
            _profileManager       = new ProfileManager();
            _friendRequestManager = new FriendRequestManager();
            _friendProfileManager = new FriendProfileManager();

            _profilePostManager = new ProfilePostManager();
        }
예제 #3
0
 public ProfileController()
 {
     _profileManager        = new ProfileManager();
     _hobbieManager         = new HobbieManager();
     _friendRequestManager  = new FriendRequestManager();
     _friendProfileManager  = new FriendProfileManager();
     _visitorProfileManager = new VisitorProfileManager();
     _profilePostManager    = new ProfilePostManager();
 }
예제 #4
0
        public async Task <IActionResult> SendFriendRequest(string receiverId)
        {
            var now = Timestamp.GetCurrentTimestamp();

            FriendRequestManager friendRequest = new FriendRequestManager(new FriendRequestDal());
            var result = await friendRequest.Add(new FriendRequest(UserConstants.userId, receiverId, now, false));

            if (result.Success)
            {
                ViewBag.Result = result.Success;
                return(View("Index", ViewBag));
            }
            return(View("Index", ViewBag));
        }
예제 #5
0
        public void AcceptFriend(int friendRequestId)
        {
            var friendRequestManager = new FriendRequestManager();
            var friendProfileManager = new FriendProfileManager();
            var friendRequest        = friendRequestManager.AcceptFriendRequest(friendRequestId);

            friendProfileManager.Add(new FriendRelationshiop()
            {
                UserProfileId       = friendRequest.UserProfileId,
                FriendUserProfileId = friendRequest.FriendUserProfileId
            });

            friendProfileManager.Add(new FriendRelationshiop()
            {
                UserProfileId       = friendRequest.FriendUserProfileId,
                FriendUserProfileId = friendRequest.UserProfileId,
            });
        }
        public void AcceptFriend(long friendRequestId)
        {
            var friendRequestManager = new FriendRequestManager();
            var friendProfileManager = new FriendProfileManager();
            var friendRequest        = friendRequestManager.AcceptFriendRequest(friendRequestId);

            friendProfileManager.Add(new FriendProfile()
            {
                ProfileId       = friendRequest.ProfileId,
                FriendProfileId = friendRequest.FriendRequestProfileId,
                IsFavourite     = false
            });

            friendProfileManager.Add(new FriendProfile()
            {
                ProfileId       = friendRequest.FriendRequestProfileId,
                FriendProfileId = friendRequest.ProfileId,
                IsFavourite     = false
            });
        }
예제 #7
0
        public void AddFriend(string userId)
        {
            var friendRequestManager = new FriendRequestManager();
            var profileManager       = new ProfileManager();
            var currentUserId        = User.Identity.GetUserId();
            var currentProfile       = profileManager.GetByUserId(currentUserId);

            var friendProfile = profileManager.GetByUserId(userId);
            var areFriend     = friendRequestManager.AreFriends(currentUserId, userId);

            if (!areFriend)
            {
                var friend = new FriendRequest
                {
                    UserId              = currentUserId,
                    UserProfileId       = currentProfile.Id,
                    FriendUserId        = userId,
                    FriendUserProfileId = friendProfile.Id,
                    IsFriend            = false,
                };

                friendRequestManager.Add(friend);
            }
        }
 public FriendRequestsComplexManagers()
 {
     uow = new UnitOfWork(new AydinUniversityProject.Database.Context.AydinUniversityProjectContext());
     userManager = uow.GetManager<UserManager,User>();
     frManager = uow.GetManager<FriendRequestManager,FriendRequest>();
 }
예제 #9
0
        public void DeclineFriend(int friendRequestId)
        {
            var friendRequestManager = new FriendRequestManager();

            friendRequestManager.DeclineFriendRequest(friendRequestId);
        }
예제 #10
0
 public FriendRequestController(FriendRequestManager repo)
 {
     _repo = repo;
 }