public static void SaveFriendInvitation(FriendInvitation friendInvitation) { if (friendInvitation.InvitationID > 0) { FriendInvitation.Update(friendInvitation); } else { friendInvitation.CreateDate = DateTime.Now; FriendInvitation.Add(friendInvitation); } }
public void Init(IRegister view, bool IsPostBack) { _view = view; _email = ObjectFactory.GetInstance<IEmail>(); _webContext = ObjectFactory.GetInstance<IWebContext>(); _accountService = ObjectFactory.GetInstance<IAccountService>(); _friendService = ObjectFactory.GetInstance<IFriendService>(); if (!IsPostBack) _view.LoadTerms(Term.GetCurrentTerm()); if (!string.IsNullOrEmpty(_webContext.FriendshipRequest)) { friendInvitation = FriendInvitation.GetFriendInvitationByGUID(new Guid(_webContext.FriendshipRequest)); _view.LoadEmailAddressFromFriendInvitation(friendInvitation.Email); } }
//removes multiple requests by the same account to the same email account public static void CleanUpFriendInvitationsForThisEmail(FriendInvitation friendInvitation) { FriendInvitation.DeleteMany(fi => fi.Email == friendInvitation.Email && fi.BecameAccountID == 0 && fi.AccountID == friendInvitation.AccountID); }