/// <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); }