public TwitterController(IFormsAuthenticationService FormsAuthService) { _db = new SiteDB(); _log = new UserActivity(_db); this.FormsAuthService = FormsAuthService; }
public SessionController(IFormsAuthenticationService FormsAuthService, IMembershipService MembershipService) { _db = new SiteDB(); _log = new UserActivity(_db); this.FormsAuthService = FormsAuthService; this.MembershipService = MembershipService; }
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(); }
public SessionController(ISession session, IFormsAuthenticationService FormsAuthService, IMembershipService MembershipService) { _session = session; _userRepository = new UserRepository(_session); _log = new UserActivity(_session); this.FormsAuthService = FormsAuthService; this.MembershipService = MembershipService; }
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(); } }
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(); } }