Example #1
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();
 }
Example #2
0
 public ShowFriendPresenter()
 {
     _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession = new SPKTCore.Core.Impl.UserSession();
     _friendService = new FriendService();
     _ac = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
     _webcontext = new WebContext();
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _redirector = new Redirector();
            _usersession = new UserSession();
            _webcontext=new WebContext();
            _fi=new FriendInvitationRepository();
            _ac = new AccountRepository();
            _mr = new MessageRecipientRepository();
            _f = new FriendService();
            Account acid;

            if (_usersession.CurrentUser != null)
            {
                if (_webcontext.AccountID != _usersession.CurrentUser.AccountID && _webcontext.AccountID != 0)
                {
                    acid = _ac.GetAccountByID(_webcontext.AccountID);
                    lblProfileName.Text = acid.UserName;
                    lb_ban.Text = " ( " + _f.SearchFriend(acid).Count.ToString() + " )";
                    testImage.Src = "~/Image/ProfileAvatar.aspx?AccountID=" + acid.AccountID;
                    AccordionPane1.Visible = false;
                    AccordionPane3.Visible = false;
                    id = acid.AccountID;
                    lbtnChangeAvatar.Visible = false;
                }
                else
                {
                    lblProfileName.Text = _usersession.CurrentUser.UserName;
                    lb_ban.Text = " ( " + _f.SearchFriend(_usersession.CurrentUser).Count.ToString() + " )";
                    testImage.Src = "~/Image/ProfileAvatar.aspx?AccountID=" + _usersession.CurrentUser.AccountID;
                    AccordionPane1.Visible = true;
                    AccordionPane3.Visible = true;
                    lb_invite.Text = " ( " + _fi.FriendInv(_usersession.CurrentUser).Count.ToString() + " )";
                    id = _usersession.CurrentUser.AccountID;
                    lb_message.Text = " ( 0 ) ";
                    lbtnChangeAvatar.Visible = true;
                    //lb_message.Text = " ( " + _mr.getMessageRecipientByAccountID(_usersession.CurrentUser.AccountID).Count.ToString() + " ) ";
                }
            }
            else
            {
                if (_webcontext.AccountID > 0)
                {
                    acid = _ac.GetAccountByID(_webcontext.AccountID);
                    lblProfileName.Text = acid.UserName;
                    testImage.Src = "~/Image/ProfileAvatar.aspx?AccountID=" + acid.AccountID;
                    AccordionPane1.Visible = false;
                    AccordionPane3.Visible = false;
                    id = acid.AccountID;
                    lbtnChangeAvatar.Visible = false;
                }
                else
                    _redirector.GoToAccountLoginPage();

            }
        }
Example #4
0
 public void LoadFriend()
 {
     UserSession _usersession = new UserSession();
     FriendService frs = new FriendService();
     List<Object> usename = new List<object>();
     foreach (Account a in frs.SearchFriend(_usersession.CurrentUser))
     {
         usename.Add(a.DisplayName);
     }
     friend.DataSource = usename;
     friend.DataBind();
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _redirector = new Redirector();
     _usersession = new UserSession();
     _webcontext = new WebContext();
     _fi = new FriendInvitationRepository();
     _ac = new AccountRepository();
     _f = new FriendService();
     if (_usersession != null)
     {
         if (_webcontext.AccountID != _usersession.CurrentUser.AccountID && _webcontext.AccountID != 0)
         {
             bt_add0.Visible = true;
             bt_add.Visible = false;
         }
         else
         {
             bt_add0.Visible = false;
             bt_add.Visible = true;
         }
     }
 }
Example #6
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();
 }