Exemple #1
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));
        }
Exemple #2
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;
         }
     }
 }