コード例 #1
0
        public TwitterController(IFormsAuthenticationService FormsAuthService)
        {
            _db = new SiteDB();
            _log = new UserActivity(_db);

            this.FormsAuthService = FormsAuthService;
        }
コード例 #2
0
        public SessionController(IFormsAuthenticationService FormsAuthService, IMembershipService MembershipService)
        {
            _db = new SiteDB();
            _log = new UserActivity(_db);

            this.FormsAuthService = FormsAuthService;
            this.MembershipService = MembershipService;
        }
コード例 #3
0
 public void LogIt(long userId, string activity)
 {
     var log = new UserActivity();
     log.Activity = activity;
     log.Created = DateTime.Now;
     log.UserID = userId;
     _db.UserActivitys.Add(log);
     _db.SaveChanges();
 }
コード例 #4
0
        public SessionController(ISession session, IFormsAuthenticationService FormsAuthService, IMembershipService MembershipService)
        {
            _session = session;
            _userRepository = new UserRepository(_session);
            _log = new UserActivity(_session);

            this.FormsAuthService = FormsAuthService;
            this.MembershipService = MembershipService;
        }
コード例 #5
0
 public virtual void LogIt(long userId, string activity)
 {
     using (ITransaction tx = _session.BeginTransaction())
     {
         var log = new UserActivity();
         log.Activity = activity;
         log.Created = DateTime.Now;
         log.UserId = userId;
         _session.Save(log);
         tx.Commit();
     }
 }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: crdeutsch/WatchedIt
        public HomeController(IFormsAuthenticationService FormsAuthService)
        {
            _db = new SiteDB();
            _log = new UserActivity(_db);

            this.FormsAuthService = FormsAuthService;

            //since CurrentUserId is used a lot save it in a variable right away for easier to read code.
            if (System.Web.HttpContext.Current.Request.IsAuthenticated)
            {
                CurrentUserId = FormsAuthService.GetCurrentUserId();
            }
        }