/// <summary> /// Gets the count of users that logged in between the selected dates /// based on the criteria chosen in the form /// </summary> private int GetLoginCountBetweenDates(DateTime?startDate, DateTime?endDate) { AuditUserHistoryFinder finder = new AuditUserHistoryFinder { UserIdFinder = GetUserIdFinderFromForm(), SuccessfulLogins = true, StartDate = startDate, EndDate = endDate }; return(AuditUserHistory.GetCount(finder)); }
/// <summary> /// Gets the first login date. If there are no logins, DateTime.MinValue is returned. /// </summary> private static DateTime GetFirstLoginDate() { AuditUserHistoryFinder finder = new AuditUserHistoryFinder { AuditUserAction = AuditUserAction.UserLogin }; var auh = AuditUserHistory.FindOne(finder); return((auh.IsNull) ? DateTime.MinValue : auh.Date); }
public static void LogUserAction(User user, AuditUserAction auditUserAction, string notes) { AuditUserHistory auh = AuditUserHistory.New(); auh.SessionId = BusinessHelper.GetCurrentSessionId(); auh.IpAddress = BusinessHelper.GetCurrentIpAddress(); auh.AuditUserActionId = Convert.ToInt32(auditUserAction); auh.UserId = user.UserId.GetValueOrDefault(); auh.Notes = notes; auh.Date = DateTime.Now; AuditUserHistory.Update(auh); m_Logger.InfoFormat("LogUserAction - User: {0}, Action: {1}, Notes: {2}", user.FullName, auditUserAction, notes); }
public override object GetDataSource() { return(AuditUserHistory.GetAssetActionList()); }