Exemple #1
0
        /// <summary>
        /// Se encarga de escribir el error basado en la configuracion del log4Net
        /// </summary>
        public static void WriteEvent(String msgContent, ListValues.EventType type, 
            Exception ex, String user, ListValues.ErrorCategory category)
        {

            WriteLog wlog = new WriteLog();
            //ILog logger = wlog.getLogger();
            //log4net.Config.XmlConfigurator.Configure();
            //log4net.Config.BasicConfigurator.Configure();

/*
            if (type == ListValues.EventType.Error)
                logger.Error(msgContent, ex);

            if (type == ListValues.EventType.Fatal)
                logger.Fatal(msgContent, ex);

            if (type == ListValues.EventType.Info)
                logger.Info(msgContent);

            if (type == ListValues.EventType.Warn)
                logger.Warn(msgContent, ex);
*/

            //Incluir Salvar en base de datos clase error.
            LogError logError = new LogError
            {
                UserError = msgContent,
                TechError = WriteLog.GetTechMessage(ex), 
                Category = category.ToString(),  CreatedBy = (user != null) ? user: "", 
                CreationDate = DateTime.Now 
            };
            
            wlog.Factory.DaoLogError().Save(logError);

        }
Exemple #2
0
        public IList<LogError> Select(LogError data)
        {

                IList<LogError> datos = new List<LogError>();
                datos = GetHsql(data).List<LogError>();
                if (!Factory.IsTransactional)
                    Factory.Commit();
                return datos;
            
        }
Exemple #3
0
 public void DeleteLogError(LogError data) { Factory.DaoLogError().Delete(data); }
Exemple #4
0
 public void UpdateLogError(LogError data) { Factory.DaoLogError().Update(data); }
Exemple #5
0
 public LogError SaveLogError(LogError data) { return Factory.DaoLogError().Save(data); }
Exemple #6
0
 public IList<LogError> GetLogError(LogError data) { return Factory.DaoLogError().Select(data); }
Exemple #7
0
        public IList<long> SelectRulesMessage(LogError data, Entities.Report.MessageRuleByCompany rule)
        {
            string sQuery = "";

            sQuery = "select LogErrorID from General.LogError a left outer join Report.MessagePool m on a.LogErrorID = m.RecordID " +
               " and m.EntityID = :idx1 and m.RuleID  = :rule Where  " +
               "  ( a.CreationDate >= :dtm1 or a.ModDate  >= :dtm1 ) and m.RecordID is null ";


            StringBuilder sql = new StringBuilder(sQuery);

            if (data != null)
            {
                Parms = new List<Object[]>();
                Parms.Add(new Object[] { "dtm1", DateTime.Today.AddDays(-5) }); //Limita a enviar solo los del dia
                Parms.Add(new Object[] { "idx1", EntityID.LogError });
                Parms.Add(new Object[] { "rule", rule.RowID }); //Rule a ejecutar



                if (! String.IsNullOrEmpty(data.Category))
                {
                    sql.Append(" and a.Category = :id3   ");
                    Parms.Add(new Object[] { "id3", data.Category });

                }


            }

            sql = new StringBuilder(sql.ToString());

            IQuery query = Factory.Session.CreateSQLQuery(sql.ToString());
            SetParameters(query);
            return query.List<long>();
        }
Exemple #8
0
 public LogError SelectById(LogError data)
 {
     return (LogError)base.SelectById(data);
 }
Exemple #9
0
 public Boolean Delete(LogError data)
 {
     return base.Delete(data);
 }
Exemple #10
0
 public Boolean Update(LogError data)
 {
     return base.Update(data);
 }
Exemple #11
0
 public LogError Save(LogError data)
 {
     return (LogError)base.Save(data);
 }