public void Init(IConfirmFriendshipRequest view) { _view = view; if (!string.IsNullOrEmpty(_webContext.FriendshipRequest)) { FriendInvitation friendInvitation = FriendInvitation.GetFriendInvitationByGUID(new Guid(_webContext.FriendshipRequest)); if (friendInvitation != null) { if (_webContext.CurrentUser != null){ LoginClick(); //if (!string.IsNullOrEmpty(_webContext.FriendshipRequest)) // _friendService.CreateFriendFromFriendInvitation(new Guid(_webContext.FriendshipRequest), _webContext.CurrentUser); } Account account = Account.GetAccountByID(friendInvitation.AccountID); _view.ShowConfirmPanel(true); _view.LoadDisplay(_webContext.FriendshipRequest, account.AccountID, account.FirstName, account.LastName, _configuration.SiteName); } else { _view.ShowConfirmPanel(false); _view.ShowMessage("Lỗi thực thi."); } } else { _redirector.GoToHomePage(); } }
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"); } } }