/// <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); }
public IList<LogError> Select(LogError data) { IList<LogError> datos = new List<LogError>(); datos = GetHsql(data).List<LogError>(); if (!Factory.IsTransactional) Factory.Commit(); return datos; }
public void DeleteLogError(LogError data) { Factory.DaoLogError().Delete(data); }
public void UpdateLogError(LogError data) { Factory.DaoLogError().Update(data); }
public LogError SaveLogError(LogError data) { return Factory.DaoLogError().Save(data); }
public IList<LogError> GetLogError(LogError data) { return Factory.DaoLogError().Select(data); }
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>(); }
public LogError SelectById(LogError data) { return (LogError)base.SelectById(data); }
public Boolean Delete(LogError data) { return base.Delete(data); }
public Boolean Update(LogError data) { return base.Update(data); }
public LogError Save(LogError data) { return (LogError)base.Save(data); }