本文整理汇总了C#中IAccountRepository.GetAccountByID方法的典型用法代码示例。如果您正苦于以下问题:C# IAccountRepository.GetAccountByID方法的具体用法?C# IAccountRepository.GetAccountByID怎么用?C# IAccountRepository.GetAccountByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAccountRepository
的用法示例。
在下文中一共展示了IAccountRepository.GetAccountByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
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 + " <" + _account.Email + ">");
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);
}
}
}
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
_profileRepository = new ProfileRepository();
_userSession =new UserSession();
_accountRepository = new AccountRepository();
_webContext = new WebContext();
//load an image by passed in accountid
//if (_webContext.AccoundIdToInvite> 0)
//{
// accountID = _webContext.AccoundIdToInvite;
// profile = _profileRepository.GetProfileByAccountID(accountID);
// account = _accountRepository.GetAccountByID(accountID);
//}
if (_webContext.AccountID> 0)
{
accountID = _webContext.AccountID;
profile = _profileRepository.GetProfileByAccountID(accountID);
account = _accountRepository.GetAccountByID(accountID);
}
//get an image for the current user
else
{
if (_userSession.LoggedIn && _userSession.CurrentUser != null)
{
account = _userSession.CurrentUser;
profile = _profileRepository.GetProfileByAccountID(account.AccountID);
}
}
//show the appropriate image
if (_webContext.ShowGravatar || (profile != null && profile.UseGrAvatar == 1))
{
Response.Redirect(GetGravatarURL());
}
else if (profile != null && profile.Avatar != null)
{
Response.Clear();
Response.ContentType = profile.AvatarMimeType;
Response.BinaryWrite(profile.Avatar.ToArray());
}
else
{
Response.Redirect("~/Image/ALIEN_01_01.jpg");
}
}