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); }
protected void Button1_Click(object sender, EventArgs e) { AccountRepository ac = new AccountRepository(); FileRepository fr = new FileRepository(); _usersession = new UserSession(); Share s = new Share(); Account a = ac.GetAccountByUsername(friend.Text); File f = fr.GetFileByID(long.Parse(FileID.Text)); s.Shared(a, _usersession.CurrentUser, f); }
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(); } }
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 LoadDisplay(Account account) { _ac = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _account = account; lblName.Text = account.DisplayName; lblUsername.Text = account.UserName; lblCreateDate.Text = account.CreateDate.ToString(); lblFriendID.Text = account.AccountID.ToString(); if (_ac.fullname(account.AccountID) == null) { lblName.Text = account.UserName; } lblemail.Text = account.Email; }
//moi public List<Account> FriendInv(Account account) { _accountRepository = new AccountRepository(); List<Account> list = new List<Account>(); using (SPKTDataContext dc = conn.GetContext()) { IEnumerable<Account> ac = (from a in dc.FriendInvitations join b in dc.Accounts on a.AccountID equals b.AccountID where (a.Email == account.Email && a.BecameAccoutnID == 0) select _accountRepository.GetAccountByID(a.AccountID)).Distinct(); list = ac.ToList(); } return list; }
protected void Page_Load(object sender, EventArgs e) { _usersession = new UserSession(); _ac = new AccountRepository(); _pr = new UserProfilePresenter(); _statusService = new SPKTCore.Core.Impl.StatusUpdateService(); Friendship1.setidac(acid); com1.setidac(acid); // add.setidac(acid); mess1.setidac(acid); load(); com1.setidst(idst); //mess1.setidac(Int32.Parse(Label3.Text)); }
public void LoadDisplay(Account account) { IRedirector r = new Redirector(); _ac = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _account = account; lblName.Text = account.DisplayName; linkAvatar.HRef = r.GetProfileURL(account.UserName); lblUsername.Text = account.UserName; linkUsername.HRef = r.GetProfileURL(account.UserName); lblCreateDate.Text = account.CreateDate.ToString(); lblFriendID.Text = account.AccountID.ToString(); if (_ac.fullname(account.AccountID) == null) { lblName.Text = account.UserName; } lblemail.Text = account.Email; }
public void LoadDisplay(Account account) { _ac = new SPKTCore.Core.DataAccess.Impl.AccountRepository(); _account = account; //_profile = profile; //ibInviteFriend.Attributes.Add("FriendsID", _account.AccountID.ToString()); //ibDelete.Attributes.Add("FriendsID", _account.AccountID.ToString()); //litAccountID.Text = account.AccountID.ToString(); // if (_profile.FullName == null) lblName.Text = account.UserName; //lblUsername.Text = account.UserName; lblCreateDate.Text = account.CreateDate.ToString(); //lblName.Text = account.Email; //lblCreateDate.Text = account.CreateDate.ToString(); //imgAvatar.ImageUrl += "?AccountID=" + account.AccountID.ToString(); //lblUsername.Text = account.UserName; lblFriendID.Text = account.AccountID.ToString(); }
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; } } }
protected void LinkButton1_Click(object sender, EventArgs e) { AccountRepository ac = new AccountRepository(); FileRepository fr = new FileRepository(); WebContext webcontext = new WebContext(); UserSession usersession = new UserSession(); _usersession = new UserSession(); if (webcontext.AccountID > 0 && usersession.CurrentUser.AccountID != webcontext.AccountID) { Share s = new Share(); Account a = ac.GetAccountByID(webcontext.AccountID); File f = fr.GetFileByID(long.Parse(FileID.Text)); s.Shared(_usersession.CurrentUser, a, f); pnm.Visible = false; } else { pnm.Visible = true; } }
protected void Button1_Click(object sender, EventArgs e) { AccountRepository ac = new AccountRepository(); FolderRepository fr = new FolderRepository(); WebContext webcontext = new WebContext(); UserSession usersession = new UserSession(); _usersession = new UserSession(); Share s = new Share(); Account a = ac.GetAccountByUsername(friend.Text); Folder f = fr.GetFolderByID(long.Parse(FolderID.Text)); s.Shared1(a, _usersession.CurrentUser, f); }
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)); }
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()+" "; }
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(); }
public override MembershipUser GetUser(string username, bool userIsOnline) { AccountRepository account = new AccountRepository(); Account acc = account.GetAccountByUsername(username); if (acc != null) { MembershipUser memUser = new MembershipUser("CustomMembershipProvider", username, acc.AccountID, acc.Email, string.Empty, string.Empty, true, false, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.Now, DateTime.Now); return memUser; } return null; }