Beispiel #1
0
 public AccountService()
 {
     _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _permissionRepository = new SPKTCore.Core.DataAccess.Impl.PermissionRepository();
     _userSession = new UserSession();
     _redirector = new Redirector();
     _email = new Email();
     _profileService = new ProfileService();
     _webContext=new SPKTCore.Core.Impl.WebContext();
     _friendService = new SPKTCore.Core.Impl.FriendService();
     friendInvitation = new FriendInvitation();
 }
Beispiel #2
0
 public RegisterPresenter()
 {
     _accountService = new AccountService();
     _webContext = new WebContext();
     _email = new Email();
     _redirector = new Redirector();
     _parameterIntService = new ParameterIntService();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _friendService = new SPKTCore.Core.Impl.FriendService();
     _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     friendInvitation = new FriendInvitation();
 }
 public void CleanUpFriendInvitationsForThisEmail(FriendInvitation friendInvitation)
 {
     using (SPKTDataContext dc = conn.GetContext())
     {
         IEnumerable<FriendInvitation> friendInvitations = from fi in dc.FriendInvitations
                                                           where fi.Email == friendInvitation.Email &&
                                                             fi.BecameAccoutnID == 0 &&
                                                             fi.AccountID == friendInvitation.AccountID
                                                           select fi;
         foreach (FriendInvitation invitation in friendInvitations)
         {
             dc.FriendInvitations.DeleteOnSubmit(invitation);
         }
         dc.SubmitChanges();
     }
 }
 public void SaveFriendInvitation(FriendInvitation friendInvitation)
 {
     using (SPKTDataContext dc = conn.GetContext())
     {
         if (friendInvitation.FriendInvitationID> 0)
         {
             dc.FriendInvitations.Attach(friendInvitation, true);
         }
         else
         {
             friendInvitation.CreateDate = DateTime.Now;
             dc.FriendInvitations.InsertOnSubmit(friendInvitation);
         }
         dc.SubmitChanges();
     }
 }
Beispiel #5
0
        public void Init(IRegister View)
        {
            _view = View;

            if (!string.IsNullOrEmpty(_webContext.FriendshipRequest))
            {
                friendInvitation = _friendInvitationRepository.GetFriendInvitationByGUID(new Guid(_webContext.FriendshipRequest));
                _view.LoadEmailAddressFromFriendInvitation(friendInvitation.Email);
            }
        }
Beispiel #6
0
 partial void DeleteFriendInvitation(FriendInvitation instance);
Beispiel #7
0
 partial void UpdateFriendInvitation(FriendInvitation instance);
Beispiel #8
0
 partial void InsertFriendInvitation(FriendInvitation instance);
Beispiel #9
0
        public string SendInvitations(Account sender, string ToEmailArray, string Message)
        {
            string resultMessage = Message;
            foreach (string s in ToEmailArray.Split(new char[] { ',', ';' }))
            {
                _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
                FriendInvitation friendInvitation = new FriendInvitation();
                friendInvitation.AccountID = sender.AccountID;
                friendInvitation.Email = s;
                friendInvitation.GUID = Guid.NewGuid();
                friendInvitation.BecameAccoutnID = 0;
                _friendInvitationRepository.SaveFriendInvitation(friendInvitation);

                SendFriendInvitation(s, sender.UserName, friendInvitation.GUID.ToString(), Message);
                resultMessage += " - " + s + "<BR>";
            }
            return resultMessage;
        }
Beispiel #10
0
 //
 public void Send_Invitations(Account sender,Account invite)
 {
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
         FriendInvitation friendInvitation = new FriendInvitation();
         friendInvitation.AccountID = sender.AccountID;
         friendInvitation.Email = invite.Email;
         friendInvitation.GUID = Guid.NewGuid();
         friendInvitation.BecameAccoutnID = invite.AccountID;
         _friendInvitationRepository.SaveFriendInvitation(friendInvitation);
 }
Beispiel #11
0
 //moi
 public void SendInvitations1(Account sender, string ToEmailArray,string ms)
 {
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
         FriendInvitation friendInvitation = new FriendInvitation();
         friendInvitation.AccountID = sender.AccountID;
         friendInvitation.Email = ToEmailArray;
         friendInvitation.GUID = Guid.NewGuid();
         friendInvitation.BecameAccoutnID = 0;
         _friendInvitationRepository.SaveFriendInvitation(friendInvitation);
         SendFriendInvitation(ToEmailArray, sender.UserName, friendInvitation.GUID.ToString(), ms);
 }