private void ForceLogOff() { int officeId = CurrentSession.GetOfficeId(); Collection <ApplicationDateModel> applicationDates = ApplicationStateHelper.GetApplicationDates(); if (applicationDates != null) { ApplicationDateModel model = applicationDates.FirstOrDefault(c => c.OfficeId.Equals(officeId)); if (model != null) { if (model.ForcedLogOffTimestamp != null) { if (model.ForcedLogOffTimestamp <= DateTime.Now && model.ForcedLogOffTimestamp >= CurrentSession.GetSignInTimestamp()) { RequestLogOnPage(); } } } } }