Exemplo n.º 1
0
        public override void StartFailedSession(User user, string userName, string applicationSessionID, string message)
        {
            if (null != this.UserSession)
            {
                throw new Exception("");
            }

            if (user != null)
            {
                this.User = (SelfAuthenticatedUser)user;
            }

            DateTime          now = DateTime.Now;
            BudgetUserSession us  = new BudgetUserSession
            {
                System               = this.MySystem,
                User                 = this.User,
                FromIPAddress        = this.FromIPAddress,
                ApplicationSessionID = applicationSessionID,
                LoginFailed          = true,
                LoginMessage         = message,
                UserName             = userName,
                SessionPeriod        = new TimeInterval(now, now),
            };

            us.Save(this);
            this.PersistenceSession.Flush();
            this.UserSession = us;
        }
Exemplo n.º 2
0
        public override void StartNewSession(User user, string applicationSessionID)
        {
            this.User = (SelfAuthenticatedUser)user;

            BudgetUserSession us = new BudgetUserSession
            {
                System               = this.MySystem,
                User                 = this.User,
                FromIPAddress        = this.FromIPAddress,
                ApplicationSessionID = applicationSessionID,
                LoginFailed          = false,
                UserName             = user.LoginName,
                SessionPeriod        = new TimeInterval(DateTime.Now),
            };

            us.Save(this);
            this.PersistenceSession.Flush();
            this.UserSession = us;
        }