Exemplo n.º 1
0
 /// <summary>
 /// Initialises new instance of <see cref="InviteFriendsController"></see>
 /// </summary>
 /// <param name="iFriendInvitationRepository">Friend Repository</param>
 /// <param name="mailer">Mailer</param>
 /// <param name="encDecryption">Encrypt and Decryptor</param>
 public InviteFriendsController(IFriendInvitationRepository iFriendInvitationRepository, IMailer mailer, IDataMorpher encDecryption, IUserSession userSession)
 {
     this.iFriendInvitationRepository = iFriendInvitationRepository;
     this.mailer        = mailer;
     this.encDecryption = encDecryption;
     this.userSession   = userSession;
 }
Exemplo n.º 2
0
 public BoxFriendPresenter()
 {
     _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession      = new SPKTCore.Core.Impl.UserSession();
     _friendService    = new FriendService();
     _friendInvite     = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
 }
Exemplo n.º 3
0
        public void Init(IInviteFriends view)
        {
            _view = view;
            //_userSession = ObjectFactory.GetInstance<IUserSession>();
            //_email = ObjectFactory.GetInstance<IEmail>();
            //_friendInvitationRepository = ObjectFactory.GetInstance<IFriendInvitationRepository>();
            //_accountRepository = ObjectFactory.GetInstance<IAccountRepository>();
            //_webContext = ObjectFactory.GetInstance<IWebContext>();
            _userSession = new SPKTCore.Core.Impl.UserSession();
            _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
            _email      = new SPKTCore.Core.Impl.Email();
            _webContext = new SPKTCore.Core.Impl.WebContext();
            if (_userSession.LoggedIn)
            {
                _account           = _userSession.CurrentUser;
                _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
                if (_account != null)
                {
                    _view.DisplayToData(_account.UserName + " &lt;" + _account.Email + "&gt;");

                    if (_webContext.AccoundIdToInvite > 0)
                    {
                        _accountToInvite = _accountRepository.GetAccountByID(_webContext.AccoundIdToInvite);

                        if (_accountToInvite != null)
                        {
                            SendInvitation(_accountToInvite.Email,
                                           _account.UserName + " " + _account.UserName + " ");
                            _view.ShowMessage(_accountToInvite.UserName + " Đã được gửi đi!");
                            _view.TogglePnlInvite(false);
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void Init(IInviteFriends view)
        {
            _view = view;
            //_userSession = ObjectFactory.GetInstance<IUserSession>();
            //_email = ObjectFactory.GetInstance<IEmail>();
            //_friendInvitationRepository = ObjectFactory.GetInstance<IFriendInvitationRepository>();
            //_accountRepository = ObjectFactory.GetInstance<IAccountRepository>();
            //_webContext = ObjectFactory.GetInstance<IWebContext>();
            _userSession = new SPKTCore.Core.Impl.UserSession();
            _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
            _email = new SPKTCore.Core.Impl.Email();
            _webContext = new SPKTCore.Core.Impl.WebContext();
            if (_userSession.LoggedIn)
            {
                _account = _userSession.CurrentUser;
                _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
                if (_account != null)
                {
                    _view.DisplayToData(_account.UserName + " &lt;" + _account.Email + "&gt;");

                    if (_webContext.AccoundIdToInvite > 0)
                    {
                        _accountToInvite = _accountRepository.GetAccountByID(_webContext.AccoundIdToInvite);

                        if (_accountToInvite != null)
                        {
                            SendInvitation(_accountToInvite.Email,
                                           _account.UserName + " " + _account.UserName + " ");
                            _view.ShowMessage(_accountToInvite.UserName + " Đã được gửi đi!");
                            _view.TogglePnlInvite(false);
                        }
                    }
                }
            }
        }
 public ConfirmFriendshipRequestPresenter()
 {
     _webContext = new SPKTCore.Core.Impl.WebContext();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _redirector = new SPKTCore.Core.Impl.Redirector();
 }
Exemplo n.º 6
0
 public BoxFriendPresenter()
 {
     _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession = new SPKTCore.Core.Impl.UserSession();
     _friendService = new FriendService();
     _friendInvite = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
 }
 public ConfirmFriendshipRequestPresenter()
 {
     _webContext = new SPKTCore.Core.Impl.WebContext();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _accountRepository          = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _redirector = new SPKTCore.Core.Impl.Redirector();
 }
Exemplo n.º 8
0
 public FriendService()
 {
     _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _webContext = new SPKTCore.Core.Impl.WebContext();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession = new SPKTCore.Core.Impl.UserSession();
 }
Exemplo n.º 9
0
 public FriendService()
 {
     dc = new SPKTDataContext();
     _accountRepository          = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _webContext                 = new SPKTCore.Core.Impl.WebContext();
     _friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _friendRepository           = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession                = new SPKTCore.Core.Impl.UserSession();
 }
Exemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi          = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f           = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _ac          = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _fs          = new SPKTCore.Core.Impl.FriendService();
     _account     = new Account();
 }
Exemplo n.º 11
0
 public ReceivedInvitationController(IFriendInvitationRepository friendInvitationRepository,
                                     UserManager <AppUser> userManager, ILogger <ReceivedInvitationController> logger,
                                     IEmailTemplateSender templateSender)
 {
     _friendInvitationRepository = friendInvitationRepository;
     _userManager    = userManager;
     _logger         = logger;
     _templateSender = templateSender;
 }
Exemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi          = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f           = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _email       = new SPKTCore.Core.Impl.Email();
     _presenter   = new ProfileDisplayPresenter();
     _ac          = new AccountRepository();
     _presenter.Init(this);
 }
Exemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _email = new SPKTCore.Core.Impl.Email();
     _presenter = new ProfileDisplayPresenter();
     _ac = new AccountRepository();
     _presenter.Init(this);
 }
Exemplo n.º 14
0
 public InvitedUserController(IInvitedUserRepository invitedUserRepository, IMeetingRepository meetingRepository,
                              IEmailTemplateSender templateSender, ILogger <InvitedUserController> logger,
                              UserManager <AppUser> userManager, IFriendInvitationRepository friendInvitationRepository)
 {
     _invitedUserRepository = invitedUserRepository;
     _meetingRepository     = meetingRepository;
     _templateSender        = templateSender;
     _logger      = logger;
     _userManager = userManager;
     _friendInvitationRepository = friendInvitationRepository;
 }
Exemplo n.º 15
0
Arquivo: Email.cs Projeto: ngocpq/MHX2
        //
        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);
        }
Exemplo n.º 16
0
Arquivo: Email.cs Projeto: ngocpq/MHX2
        //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);
        }
Exemplo n.º 17
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();
 }
Exemplo n.º 18
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();
        }
Exemplo n.º 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _rediret     = new Redirector();
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi          = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f           = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _email       = new SPKTCore.Core.Impl.Email();
     _presenter   = new ProfileDisplayPresenter();
     _webContext  = new WebContext();
     _ac          = new AccountRepository();
     _presenter.Init(this);
     Image1.ImageUrl = "~/Image/ProfileAvatar.aspx?AccountID=" + Int32.Parse(Label1.Text);
 }
Exemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _webcontext  = new WebContext();
            _usersession = new SPKTCore.Core.Impl.UserSession();
            _fi          = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
            _f           = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
            _email       = new SPKTCore.Core.Impl.Email();
            _presenter   = new ProfileDisplayPresenter();
            _ac          = new AccountRepository();
            _presenter.Init(this);
            btn_de.Attributes.Add("onclick", "javascript:return confirm('Ban co muon xoa bạn?')");
            if (_usersession.CurrentUser == null)
            {
                btn_add_de.Visible = false;
                btn_de.Visible     = false;
                btn_ok.Visible     = false;
            }
            else
            {
                if (_presenter.TestFriend(_account) == true || _presenter.TestFriend2(_account))
                {
                    btn_add_de.Visible = false;
                    btn_de.Visible     = true;
                    btn_ok.Visible     = false;
                    if (_webcontext.SearchText == lblUsername.Text)
                    {
                        btn_de.Visible   = true;
                        btn_de.Text      = "Chào bạn";
                        btn_de.BackColor = System.Drawing.Color.Gray;
                    }
                }

                else
                {
                    btn_add_de.Visible = true;
                    btn_de.Visible     = false;
                    btn_ok.Visible     = false;
                    if (_webcontext.SearchText == lblUsername.Text)
                    {
                        btn_add_de.Visible   = true;
                        btn_add_de.Text      = "Chào bạn";
                        btn_add_de.BackColor = System.Drawing.Color.Gray;
                    }
                }
                imgAvatar.ImageUrl = "~/Image/ProfileAvatar.aspx?AccountID=" + Int32.Parse(lblFriendID.Text);
            }
            more1.setacid(Int32.Parse(lblFriendID.Text));
        }
Exemplo n.º 21
0
Arquivo: Email.cs Projeto: ngocpq/MHX2
        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);
        }
Exemplo n.º 22
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;
        }
Exemplo n.º 23
0
Arquivo: Email.cs Projeto: SPKT/MHX2
 //
 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);
 }
Exemplo n.º 24
0
Arquivo: Email.cs Projeto: SPKT/MHX2
 //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);
 }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _webcontext = new WebContext();
            _usersession = new SPKTCore.Core.Impl.UserSession();
            _fi = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
            _f = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
            _email = new SPKTCore.Core.Impl.Email();
            _presenter = new ProfileDisplayPresenter();
            _ac = new AccountRepository();
            _presenter.Init(this);
            btn_de.Attributes.Add("onclick", "javascript:return confirm('Ban co muon xoa bạn?')");
            if (_usersession.CurrentUser == null)
            {
                btn_add_de.Visible = false;
                btn_de.Visible = false;
                btn_ok.Visible = false;
            }
            else
            {

                    if (_presenter.TestFriend(_account) == true || _presenter.TestFriend2(_account))
                    {
                        btn_add_de.Visible = false;
                        btn_de.Visible = true;
                        btn_ok.Visible = false;
                        if (_webcontext.SearchText == lblUsername.Text)
                        {
                            btn_de.Visible = true;
                            btn_de.Text = "Chào bạn";
                            btn_de.BackColor = System.Drawing.Color.Gray;
                        }
                    }

                    else
                    {
                        btn_add_de.Visible = true;
                        btn_de.Visible = false;
                        btn_ok.Visible = false;
                        if (_webcontext.SearchText == lblUsername.Text)
                        {
                            btn_add_de.Visible = true;
                            btn_add_de.Text = "Chào bạn";
                            btn_add_de.BackColor = System.Drawing.Color.Gray;

                        }
                    }
                    imgAvatar.ImageUrl = "~/Image/ProfileAvatar.aspx?AccountID=" + Int32.Parse(lblFriendID.Text);

            }
            more1.setacid(Int32.Parse(lblFriendID.Text));
        }
 public InvitationBubbleTagHelper(IFriendInvitationRepository friendInvitationRepository)
 {
     _friendInvitationRepository = friendInvitationRepository;
 }
Exemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _ac = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _fs = new SPKTCore.Core.Impl.FriendService();
     _account = new Account();
 }
Exemplo n.º 28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new SPKTCore.Core.Impl.UserSession();
     _fi = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
     _f = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _presenter = new ProfileDisplayPresenter();
     _presenter.Init(this);
     btn_de.Attributes.Add("onclick", "javascript:return confirm('Ban co muon xoa bạn?')");
     if (_usersession.CurrentUser == null)
     {
         btn_add_de.Visible = true;
         btn_de.Visible = false;
     }
     else
     {
         if (_presenter.TestFriend(_account) == true||_presenter.TestFriend2(_account))
         {
             btn_add_de.Visible = false;
             btn_de.Visible = true;
         }
         else
         {
             btn_add_de.Visible = true;
             btn_de.Visible = false;
         }
     }
 }
 public FriendInvitationController()
 {
     _objIFriendInvitationRepository = new FriendInvitationRepository();
 }