Ejemplo n.º 1
0
        public static Boolean _WriteEventLog(string message, EventLogType eventlogtype, RevampCoreSettings appSettings = null)
        {
            ER_Tools _tools = new ER_Tools();

            return(_tools.WriteEventLog(message, eventlogtype, appSettings));
        }
Ejemplo n.º 2
0
 public MvcApplication(IOptions <RevampCoreSettings> settings, IViewRenderService viewRenderService)
 {
     IRevampCoreSettings = settings.Value;
     _viewRenderService  = viewRenderService;
     _ConnectPrivate     = _Connect();
 }
Ejemplo n.º 3
0
        public Boolean WriteEventLog(string message, EventLogType eventlogtype, RevampCoreSettings appSettings = null)
        {
            Boolean _Result            = false;
            bool    enableEventLogging = appSettings != null ? appSettings.EnableEventLogging : true;
            string  systemName         = appSettings != null && !string.IsNullOrWhiteSpace(appSettings.SystemDBName) ? appSettings.SystemDBName : "Revamp";

            try
            {
                if (!enableEventLogging)
                {
                    return(false);
                }

                if (!EventLog.SourceExists(systemName))
                {
                    EventLog.CreateEventSource(systemName, "Application");
                }

                EventLogEntryType eventType = new EventLogEntryType();

                switch (eventlogtype.ToString().ToLower())
                {
                case "error":
                case "exception":
                    eventType = EventLogEntryType.Error;
                    break;

                case "information":
                case "general":
                    eventType = EventLogEntryType.Information;
                    break;

                case "failureaudit":
                    eventType = EventLogEntryType.FailureAudit;
                    break;

                case "successaudit":
                case "success":
                    eventType = EventLogEntryType.SuccessAudit;
                    break;

                case "warning":
                case "default":
                    eventType = EventLogEntryType.Warning;
                    break;

                default:
                    eventType = EventLogEntryType.Warning;
                    break;
                }

                EventLog.WriteEntry(systemName, message, eventType, 12839);

                _Result = true;
            }
            catch (Exception ex)
            {
                ex.ToString();
                _Result = false;
                //Can't write to Eventlog
            }

            return(_Result);
        }
Ejemplo n.º 4
0
 public PermissionCheckAttribute(IOptions <RevampCoreSettings> settings)
 {
     RevampCoreSettings = settings.Value;
 }