本文整理汇总了C#中IUserSession类的典型用法代码示例。如果您正苦于以下问题:C# IUserSession类的具体用法?C# IUserSession怎么用?C# IUserSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUserSession类属于命名空间,在下文中一共展示了IUserSession类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(IInviteFriends view)
{
_view = view;
_userSession = ObjectFactory.GetInstance<IUserSession>();
_email = ObjectFactory.GetInstance<IEmail>();
_webContext = ObjectFactory.GetInstance<IWebContext>();
_account = _userSession.CurrentUser;
if (_account != null)
{
_view.DisplayToData(_account.FirstName + " " + _account.LastName + " <" + _account.Email + ">");
if (_webContext.AccoundIdToInvite > 0)
{
_accountToInvite = Account.GetAccountByID(_webContext.AccoundIdToInvite);
if (_accountToInvite != null)
{
SendInvitation(_accountToInvite.Email,
_accountToInvite.FirstName + " " + _accountToInvite.LastName + " muốn kết bạn với bạn!");
_view.ShowMessage(" Yêu cầu kết bạn đã được gửi đến" + _accountToInvite.Username);
_view.TogglePnlInvite(false);
}
}
}
}
示例2: 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);
}
}
}
}
}
示例3: TableQueryInfo
public TableQueryInfo(IUserSession session, TableInfo tableInfo, ObjectName tableName, ObjectName aliasName)
{
Session = session;
TableInfo = tableInfo;
TableName = tableName;
AliasName = aliasName;
}
示例4: SaveCard
public ICard SaveCard(IUserSession session, ICard newCard)
{
CardEffect effect = new CardEffect
{
Affected = (int)newCard.Effect.Affected,
CardAttackChange = newCard.Effect.CardAttackChange,
CardAttackMultiplier = newCard.Effect.CardAttackMultiplier,
Description = newCard.Effect.Description,
DisableOpponentEffect = newCard.Effect.DisableOpponentEffect,
EffectTiming = (int)newCard.Effect.EffectTiming,
LifePointsChange = newCard.Effect.LifePointsChange,
Name = newCard.Effect.Name,
ProbabilityOfEffect = newCard.Effect.ProbabilityOfEffect
};
Card created = new Card
{
Name = newCard.Name,
ImageUrl = newCard.ImageUrl,
Effect = effect,
AttackPoints = newCard.AttackPoints,
DefensePoints = newCard.DefensePoints
};
RequestContext.Model<Entities>().AddToCards(created);
RequestContext.Model<Entities>().SaveChanges();
return created;
}
示例5: PublicController
public PublicController(
IMiddleManagement MiddleManagement,
IUserSession UserSession,
IFormsAuthentication FormAuthentication)
: base(MiddleManagement, UserSession, FormAuthentication)
{
}
示例6: RegisterController
/// <summary>
/// Initializes a new instance of the <see cref="JoinController"/> class.
/// </summary>
/// <param name="userRepository">The user repository.</param>
/// <param name="fileService">The file service.</param>
/// <param name="userSession">The user session.</param>
/// <param name="joinRepository">The join repository.</param>
public RegisterController(IUserRepository userRepository, IStorage fileService, IUserSession<Domain.Model.User> userSession, IJoinRepository joinRepository)
{
_userRepository = userRepository;
_joinRepository = joinRepository;
_fileService = fileService;
_userSession = userSession;
}
示例7: SessionQueryContext
public SessionQueryContext(IUserSession session)
{
if (session == null)
throw new ArgumentNullException("session");
this.session = session;
}
示例8: ValidateTheCommand
void ValidateTheCommand(IUserSession userSession, object command)
{
foreach (object validator in GetMatchingCommandValidators(command))
{
InvokeMethod("Validate", validator, userSession, command);
}
}
示例9: GetAvailableRooms
public IEnumerable<IRoom> GetAvailableRooms(IUserSession session)
{
Contract.Requires(session != null, "session is null.");
Contract.Ensures(Contract.Result<IEnumerable<IRoom>>() != null);
return default(IEnumerable<IRoom>);
}
示例10: BoxFriendPresenter
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();
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
_usersession = new UserSession();
_for = new FolderRepository();
_redirect = new Redirector();
up = new UploadAvatarPresenter();
}
示例12: ContentMenuCommandService
public ContentMenuCommandService(IContentMenuService contentMenuService, IUnitOfWork unitOfWork, ICommandExecutor executor)
{
_contentMenuService = contentMenuService;
_unitOfWork = unitOfWork;
_executor = executor;
_userSession = new UserSession();
}
示例13: OrderingHistoryCommandService
public OrderingHistoryCommandService(IOrderingHistoryService orderingHistoryService, IUnitOfWork unitOfWork, ICommandExecutor executor)
{
_orderingHistoryService = orderingHistoryService;
_unitOfWork = unitOfWork;
_executor = executor;
_userSession = new UserSession();
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
re = new SPKTCore.Core.Impl.Redirector();
_userSession = new UserSession();
if (_userSession.LoggedIn)
re.GotoHomePage();
}
示例15: AlertService
public AlertService()
{
_userSession = new UserSession();
_alertRepository = new AlertRepository();
_webContext = new WebContext();
alert = new Alert();
}