public static Entities.SMTPSettings GetSMTPSettings()
        {
            Entities.SMTPSettings settings = new Entities.SMTPSettings();
            var configs = JSSELogManager.GetConfiguration("Email");

            settings.SMTPServer  = configs.Where(x => x.ConfigKey == "SMTPServer").FirstOrDefault().ConfigValue;
            settings.FromAddress = configs.Where(x => x.ConfigKey == "FromAddress").FirstOrDefault().ConfigValue;
            return(settings);
        }
Exemple #2
0
        public void LogErrortoDatabase(Exception ex, string createdBy, string function)
        {
            T_JSSE_Log log = new T_JSSE_Log();

            log.Message       = ex.Message;
            log.CreatedBy     = createdBy;
            log.ModifiedBy    = createdBy;
            log.ModifiedDate  = DateTime.Now;
            log.CreatedDate   = DateTime.Now;
            log.Active        = true;
            log.StackTrace    = ex.StackTrace;
            log.AppURL        = ex.TargetSite.Name;
            log.EventCategory = ex.Source;
            log.EventFunction = function;
            log.EventType     = "Error";
            JSSELogManager.LogtoDatabase(log);
        }
        public int LogtoDatabase(JSSELog jsse)
        {
            int        result = 0;
            T_JSSE_Log dbJSSE = new T_JSSE_Log();

            dbJSSE.Message       = jsse.Message;
            dbJSSE.StackTrace    = jsse.Stacktrace;
            dbJSSE.EventType     = jsse.EventType;
            dbJSSE.EventCategory = jsse.EventCategory;
            dbJSSE.EventFunction = jsse.EventFunction;
            dbJSSE.AppURL        = jsse.AppURL;
            dbJSSE.CreatedBy     = jsse.UserId;
            dbJSSE.CreatedDate   = DateTime.Now;
            dbJSSE.Active        = true;
            result = JSSELogManager.LogtoDatabase(dbJSSE);
            return(result);
        }