Beispiel #1
0
        private void ClearingAbandonedSessionsTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            var errorMsg = String.Empty;

            try
            {
                //int intervalInMinutes = Convert.ToInt32(AppConfigurationHelper.GetValue<string>(ConfigKeys.SessionTimeout));
                //Set the delay in emailing people to the same as this timer interval (so if this timer runs every 30 mins, people will be emailed if they've left a quote alone for 30 mins):
                //string methodNameAndParams = String.Format("/EmailAbandonedQuickQuotes?delayInMinutes={0}", intervalInMinutes);
                //WebRequest webRequest = HttpWebRequest.Create(Properties.Settings.Default.HobNobClubApps_SLHobNobInsurance_HobNobInsurance + methodNameAndParams);
                //WebResponse webResponse = webRequest.GetResponse();

                var objUserSession = SessionManager.DeleteSessionAndLockedData(_intervalInMinutes);
                if (objUserSession != null)
                {
                    foreach (var userSession in objUserSession)
                    {
                        SessionManager.LogOff(userSession.UserId, userSession.Sessionid);
                    }
                }
            }
            catch (BusinessException ex)
            {
                errorMsg = ex.DisplayMessage;
            }
            AuditLogger.LogActivity
            (
                "Technocom-System",
                DateTime.Now,
                ScreenActivityType.Create,
                0,
                String.Format("The ClearingAbandonedSessionsTimer ran at {0} {1}", DateTime.Now, String.IsNullOrEmpty(errorMsg) ? "with no errors (from the timer)." : "and failed with: " + errorMsg),
                -1,
                -1
            );
        }
Beispiel #2
0
 public void Logout(string LoginId, string SessionId)
 {
     AuditLogger.LogActivity(LoginId, DateTime.Now, ScreenActivityType.Logout, 12, "User Logout", -1, -1);
     SessionManager.LogOff(LoginId, SessionId);
 }
Beispiel #3
0
 protected void LogActivity(ScreenActivityType screenActivityType, DateTime dateTime, int mapId, int topLevelId, int lowerLevelId, string userComment = "")
 {
     AuditLogger.LogActivity(SessionContext.UserId, dateTime, screenActivityType, SessionContext.NavigationId, userComment, topLevelId, lowerLevelId);
 }
Beispiel #4
0
 /// <summary>
 /// Logs the activity.
 /// </summary>
 /// <param name="screenActivityType">Type of the screen activity.</param>
 /// <param name="dateTime">The date time.</param>
 /// <param name="userComment">The user comment.</param>
 protected void LogActivity(ScreenActivityType screenActivityType, DateTime dateTime, string userComment = "")
 {
     AuditLogger.LogActivity(SessionContext.UserId, dateTime, screenActivityType, SessionContext.NavigationId, userComment, SessionContext.BranchId, SessionContext.DeptId);
 }