public void CreateFriendFromFriendInvitation(Guid InvitationKey, Account InvitationTo) { FriendInvitation friendInvitation = _friendInvitationRepository.GetFriendInvitationByGUID(InvitationKey); friendInvitation.BecameAccoutnID = InvitationTo.AccountID; _friendInvitationRepository.SaveFriendInvitation(friendInvitation); _friendInvitationRepository.CleanUpFriendInvitationsForThisEmail(friendInvitation); Friend friend = new Friend(); friend.AccountID = friendInvitation.AccountID; friend.MyFriendAccountID = InvitationTo.AccountID; _friendRepository.SaveFriend(friend); //_friendRepository.GetFriend(InvitationTo); }
public void Init(IRegister View) { _view = View; if (!string.IsNullOrEmpty(_webContext.FriendshipRequest)) { friendInvitation = _friendInvitationRepository.GetFriendInvitationByGUID(new Guid(_webContext.FriendshipRequest)); _view.LoadEmailAddressFromFriendInvitation(friendInvitation.Email); } }
public void Init(IConfirmFriendshipRequest view) { _view = view; if (!string.IsNullOrEmpty(_webContext.FriendshipRequest)) { FriendInvitation friendInvitation = _friendInvitationRepository.GetFriendInvitationByGUID(new Guid(_webContext.FriendshipRequest)); if (friendInvitation != null) { Account account = _accountRepository.GetAccountByID(friendInvitation.AccountID); _view.ShowConfirmPanel(true); _view.LoadDisplay(_webContext.FriendshipRequest, account.AccountID, account.UserName, "http://localhost:4120/Friends/ConfirmFriendshipRequest.aspx"); } else { _view.ShowConfirmPanel(false); _view.ShowMessage("Lỗi rồi"); } } }