GetAccountByID() public method

public GetAccountByID ( int accountID ) : Account
accountID int
return Account
Beispiel #1
0
        public Account GetAccountByID(long accountID)
        {
            AccountRepository accRep  = new AccountRepository();
            Account           account = accRep.GetAccountByID(accountID);

            return(account);
        }
Beispiel #2
0
        public void load()
        {
            Account             ac  = _ac.GetAccountByID(acid);
            List <StatusUpdate> sta = _pr.GetStatusToShow(_usersession.CurrentUser, ac);

            Avatar.ImageUrl = "~/Image/ProfileAvatar.aspx?AccountID=" + acid;
            string sts = "";

            if (sta.Count > 0)
            {
                idst = sta[0].StatusUpdateID;
                if (sts.Length > 100)
                {
                    sts         = sta[0].Status.Substring(0, 100);
                    status.Text = sts + " ...";
                    date.Text   = sta[0].CreateDate.ToString();
                }
                status.Text = sta[0].Status;
                date.Text   = sta[0].CreateDate.ToString();
            }
            status.Text = ac.DisplayName + "Chưa đang status nào cả";

            Label1.Text       = ac.DisplayName;
            Label2.Text       = acid.ToString();
            Label3.Text       = ac.AccountID.ToString();
            lb_gioithieu.Text = "Thông tin của " + ac.UserName.ToUpper();
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LogUtil.Logger.Writeln(String.Format(".  -<font color = 'cyan'><u> Comment OnInit:  RecID {0}</u></font>", idst));
     _presenter = new CommentsPresenter();
     // _presenter.Init(this, IsPostBack);
     // _presenter.LoadComments();
     _com            = new CommentRepository();
     _ac             = new AccountRepository();
     tb_comment.Text = "";
     Image1.ImageUrl = "~/Image/ProfileAvatar.aspx?AccountID=" + _usersession.CurrentUser.AccountID;
     Label1.Text     = "Bình luận cho " + _ac.GetAccountByID(idac).UserName.ToUpper() + " ";
 }
Beispiel #4
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 != 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() + " ) ";
                }
            }
        }
        public ViewResult DeleteAccount(int id)
        {
            AccountRepository _accountRepository = new AccountRepository();

            return(View(_accountRepository.GetAccountByID(id)));
        }