This commit is contained in:
jzuniga:1 2018-06-14 19:16:48 +00:00
parent c54dce6e37
commit c27c342d8b
66 changed files with 259938 additions and 48 deletions

View file

@ -67,13 +67,21 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />

View file

@ -67,6 +67,7 @@
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Moment.js" version="2.9.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="popper.js" version="1.14.0" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" />

View file

@ -48,6 +48,12 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />

View file

@ -1,4 +1,5 @@

using Atesa.Utilitarios;
using AYA.SlnSinortModel.Constantes;
using AYA.SlnSinortModel.Entidades;
using AYA.SlnSinortModel.Sinort;
@ -14,6 +15,8 @@ namespace AYA.SlnSinort.WCF
[ServiceContract]
public interface ISinortCatalogos
{
#region Mantenimiento
[OperationContract]
List<Mantenimiento> ObtenerMantenimientoCatalogos();

View file

@ -1,4 +1,5 @@

using Atesa.Utilitarios;
using AYA.SlnSinortModel.Constantes;
using AYA.SlnSinortModel.DAL.Sinort;
using AYA.SlnSinortModel.Entidades;
@ -16,6 +17,7 @@ namespace AYA.SlnSinort.WCF
public class Sinort : ISinort
{
Log log = new Log("ForoDAL");
#region ProyectoNormativo
//public List<Mantenimiento> ObtenerSitios()
//{

View file

@ -1,4 +1,5 @@
using AYA.SlnSinortModel.Constantes;
using Atesa.Utilitarios;
using AYA.SlnSinortModel.Constantes;
using AYA.SlnSinortModel.DAL.Sinort;
using AYA.SlnSinortModel.Entidades;
using AYA.SlnSinortModel.Sinort;
@ -13,6 +14,7 @@ namespace AYA.SlnSinort.WCF
{
public class SinortCatalogos : ISinortCatalogos
{
Log log = new Log("ForoDAL");
#region Mantenimiento
public List<Mantenimiento> ObtenerMantenimientoCatalogos()
@ -25,7 +27,7 @@ namespace AYA.SlnSinort.WCF
}
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -42,7 +44,7 @@ namespace AYA.SlnSinort.WCF
}
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -57,7 +59,7 @@ namespace AYA.SlnSinort.WCF
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -74,7 +76,7 @@ namespace AYA.SlnSinort.WCF
}
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -89,7 +91,7 @@ namespace AYA.SlnSinort.WCF
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -108,7 +110,7 @@ namespace AYA.SlnSinort.WCF
}
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -123,7 +125,7 @@ namespace AYA.SlnSinort.WCF
catch (Exception ex)
{
throw;
log.Error(ex);
}
return respuesta;
}
@ -132,7 +134,17 @@ namespace AYA.SlnSinort.WCF
#region Pantallas
public List<Pantallas> ObtenerPantallas(Usuario model)
{
return new PantallasDAL().ObtenerPantallas(model);
List<Pantallas> respuesta = new List<Pantallas>();
try
{
respuesta= new PantallasDAL().ObtenerPantallas(model);
}
catch (Exception ex)
{
log.Error(ex);
}
return respuesta;
}
#endregion

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
</packages>

View file

@ -67,13 +67,21 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />

View file

@ -16,8 +16,9 @@
<thead>
<tr>
<th></th>
<th class="col-sm-1">ID</th>
<th class="col-sm-1">ID Emisor</th>
<th class="col-sm-4">Descripción</th>
<th class="col-sm-4">Tipo Emisor</th>
<th></th>
</tr>
</thead>
@ -53,7 +54,22 @@
@*Descripción*@
<input type="text" class="form-control" id="txtDescripcion">
<div class="form-group">
<label class="col-sm-4 control-label ControlsForms">Descripción</label>
<div class="col-sm-8">
<input type="text" id="txtDescripcion" name="txtDescripcion" class="form-control imput-xs" />
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label ControlsForms">Tipo de Emisor</label>
<div class="col-sm-8">
<select id="ddlTipoEmisor" name="ddlTipoEmisor" class="form-control imput-xs" required></select>
</div>
</div>
<div class="form-group">
<label class="col-md-2"></label>
<div class="col-md-4 ">

View file

@ -67,6 +67,7 @@
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Moment.js" version="2.9.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="popper.js" version="1.14.0" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" />

View file

@ -42,9 +42,18 @@
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

View file

@ -15,7 +15,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class AplicacionDAL
{
Log log = new Log("AplicacionDAL");
#region ObtenerAplicacion
public List<CatalogosJSON> ObtenerAplicacion(string filtro = null)
@ -35,7 +35,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return registros;
@ -53,7 +54,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return respuesta;
@ -98,12 +100,12 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (DbEntityValidationException ex)
{
//logger.Error(exs);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
catch (Exception ex)
{
//logger.Error(ex);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
finally

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class BitacoraDocumentosDAL
{
Log log = new Log("BitacoraDocumentosDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class CategoriaDAL
{
Log log = new Log("CategoriaDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class ComentariosForoDAL
{
Log log = new Log("ComentariosForoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class ComentariosMatrizDAL
{
Log log = new Log("ComentariosMatrizDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class ConvocatoriaDAL
{
Log log = new Log("ConvocatoriaDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class DocumentosAdjuntosDAL
{
Log log = new Log("DocumentosAdjuntosDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class DocumentosDAL
{
Log log = new Log("DocumentosDAL");
}
}

View file

@ -14,7 +14,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class EmisorDAL
{
Log log = new Log("EmisorDAL");
#region ObtenerEmisor
public List<CatalogosJSON> ObtenerEmisor(string filtro = null)
@ -35,7 +35,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return registros;
@ -53,7 +54,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return respuesta;
@ -98,12 +100,12 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (DbEntityValidationException ex)
{
//logger.Error(exs);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
catch (Exception ex)
{
//logger.Error(ex);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
finally

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class EstadoDAL
{
Log log = new Log("EstadoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class ForoDAL
{
Log log = new Log("ForoDAL");
}
}

View file

@ -1,4 +1,5 @@
using AYA.SlnSinortModel.Entidades;
using Atesa.Utilitarios;
using AYA.SlnSinortModel.Entidades;
using AYA.SlnSinortModel.Sinort;
using System;
using System.Collections.Generic;
@ -10,7 +11,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class MantenimientoDAL
{
Log log = new Log("MantenimientoDAL");
public List<Mantenimiento> ObtenerMantenimientoCatalogos()
{
List<Mantenimiento> registros = null;
@ -24,7 +25,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
}
return registros;

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class MatrizDAL
{
Log log = new Log("MatrizDAL");
}
}

View file

@ -1,4 +1,5 @@
using AYA.SlnSinortModel.Sinort;
using Atesa.Utilitarios;
using AYA.SlnSinortModel.Sinort;
using System;
using System.Collections.Generic;
using System.Linq;
@ -9,8 +10,11 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class PantallasDAL
{
Log log = new Log("MatrizDAL");
public List<Pantallas> ObtenerPantallas(Usuario model)
{
List<Pantallas> registros = null;
try
{

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class PermisosUsuarioDAL
{
Log log = new Log("PermisosUsuarioDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class PlantillaEmailDAL
{
Log log = new Log("PlantillaEmailDAL");
}
}

View file

@ -14,6 +14,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class RolesDAL
{
Log log = new Log("RolesDAL");
#region ObtenerRol
public List<CatalogosJSON> ObtenerRol(string filtro = null)
@ -33,7 +35,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return registros;
@ -51,7 +54,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (Exception ex)
{
//log.Error(ex);
log.Error(ex);
throw ex;
}
return respuesta;
@ -96,12 +100,12 @@ namespace AYA.SlnSinortModel.DAL.Sinort
}
catch (DbEntityValidationException ex)
{
//logger.Error(exs);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
catch (Exception ex)
{
//logger.Error(ex);
log.Error(ex);
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
}
finally

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class TipoDocumentoDAL
{
Log log = new Log("TipoDocumentoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class TipoEmisorDAL
{
Log log = new Log("TipoEmisorDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class TipoEstadoDAL
{
Log log = new Log("TipoEstadoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class TipoForoDAL
{
Log log = new Log("TipoForoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class TipoMatrizDAL
{
Log log = new Log("TipoForoDAL");
}
}

View file

@ -1,4 +1,5 @@
using System;
using Atesa.Utilitarios;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -8,5 +9,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
{
public class UsuarioDAL
{
Log log = new Log("UsuarioDAL");
}
}

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
</packages>

View file

@ -42,12 +42,19 @@
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
</packages>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>

View file

@ -37,6 +37,14 @@
<Reference Include="APCEncryptLibrary">
<HintPath>..\..\..\..\..\..\..\..\DLL\APCEncryptLibrary.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
@ -45,12 +53,19 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@ -60,11 +75,13 @@
<ItemGroup>
<Compile Include="Encriptar.cs" />
<Compile Include="Extensiones.cs" />
<Compile Include="Log.cs" />
<Compile Include="NewtonsoftJsonDispatchFormatter.cs" />
<Compile Include="ObtieneParametros.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />

View file

@ -21,6 +21,9 @@ namespace Atesa.Utilitarios
return source;
}
public static bool In<T>(this T obj, params T[] args)
{
return args.Contains<T>(obj);
}
}
}

View file

@ -0,0 +1,158 @@
using NLog;
using NLog.Config;
using NLog.Targets;
using System;
using System.Data.Entity.Validation;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
namespace Atesa.Utilitarios
{
public class Log
{
private LogEventInfo vLogEventInfo;
[MethodImpl(MethodImplOptions.NoInlining)]
public Log(string vLoggerName)
{
this.LoggerName = vLoggerName;
string name = Assembly.GetCallingAssembly().GetName().Name;
string valueKeyRegedit = new ObtieneParametros().GetValueKeyRegedit("RutaLogGenerados", false);
string str3 = new ObtieneParametros().GetValueKeyRegedit("LogLevel", false);
LoggingConfiguration configuration = LogManager.Configuration;
configuration = (configuration == null) ? new LoggingConfiguration() : configuration;
FileTarget Target = new FileTarget
{
Name = vLoggerName,
Layout = "${date}|${machinename}|${level}|${logger}|${event-context:item=INITLogger}|${message}",
FileName = valueKeyRegedit + "/" + name + "/${logger} ${shortdate}.txt"
};
if (!((configuration.ConfiguredNamedTargets == null) || configuration.ConfiguredNamedTargets.Any<Target>(c => (c.Name == Target.Name))))
{
configuration.AddTarget(Target);
}
NLog.LogLevel trace = NLog.LogLevel.Trace;
switch (str3.Trim().ToLower())
{
case "warn":
trace = NLog.LogLevel.Warn;
break;
case "error":
trace = NLog.LogLevel.Error;
break;
default:
trace = NLog.LogLevel.Trace;
break;
}
LoggingRule rule = new LoggingRule(vLoggerName, trace, Target);
if (!configuration.LoggingRules.Any<LoggingRule>(c => (c.LoggerNamePattern == rule.LoggerNamePattern)))
{
configuration.LoggingRules.Add(rule);
}
LogManager.Configuration = configuration;
}
//[MethodImpl(MethodImplOptions.NoInlining)]
//public void Error(DbEntityValidationException ex)
//{
// StackTrace trace = new StackTrace(new StackFrame(1));
// this.MethodName = trace.GetFrame(0).GetMethod().Name;
// StringBuilder builder = new StringBuilder();
// foreach (string str in (from x in ex.EntityValidationErrors
// select x.ValidationErrors into x
// select x.ErrorMessage).ToList<string>())
// {
// builder.AppendLine(str);
// }
// builder.AppendLine(" StackTrace: ");
// builder.Append(ex.StackTrace);
// this.vLogEventInfo = new LogEventInfo(NLog.LogLevel.Error, this.LoggerName, " DbEntityValidationException Message: " + builder.ToString());
// this.vLogEventInfo.Properties["INITLogger"] = this.INITLogger;
// this.logger.Log(this.vLogEventInfo);
// builder.Clear();
//}
[MethodImpl(MethodImplOptions.NoInlining)]
public void Error(Exception ex)
{
StackTrace trace = new StackTrace(new StackFrame(1));
this.MethodName = trace.GetFrame(0).GetMethod().Name;
StringBuilder exceptionMessages = this.GetExceptionMessages(ex);
this.vLogEventInfo = new LogEventInfo(NLog.LogLevel.Error, this.LoggerName, exceptionMessages.ToString());
this.vLogEventInfo.Properties["INITLogger"] = this.INITLogger;
this.logger.Log(this.vLogEventInfo);
exceptionMessages.Clear();
}
[MethodImpl(MethodImplOptions.NoInlining)]
public void Error(string Message)
{
StackTrace trace = new StackTrace(new StackFrame(1));
this.MethodName = trace.GetFrame(0).GetMethod().Name;
Message = Message.Replace(Environment.NewLine, " -> ");
this.vLogEventInfo = new LogEventInfo(NLog.LogLevel.Error, this.LoggerName, Message);
this.vLogEventInfo.Properties["INITLogger"] = this.INITLogger;
this.logger.Log(this.vLogEventInfo);
}
public StringBuilder GetExceptionMessages(Exception ex)
{
StringBuilder builder = new StringBuilder();
while (ex != null)
{
builder.AppendLine(" Message: ");
builder.Append(ex.Message);
builder.AppendLine(" StackTrace: ");
builder.Append(ex.StackTrace);
ex = ex.InnerException;
}
return builder;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public void Trace(string Message)
{
StackTrace trace = new StackTrace(new StackFrame(1));
this.MethodName = trace.GetFrame(0).GetMethod().Name;
Message = Message.Replace(Environment.NewLine, " -> ");
this.vLogEventInfo = new LogEventInfo(NLog.LogLevel.Trace, this.LoggerName, Message);
this.vLogEventInfo.Properties["INITLogger"] = this.INITLogger;
this.logger.Log(this.vLogEventInfo);
}
private Logger logger
{
get
{
return LogManager.GetLogger(this.LoggerName);
}
}
public string IDLogger { get; set; }
public string LoggerName { get; set; }
private string MethodName { get; set; }
//private string INITLogger = "${this.MethodName}|{this.IDLogger}";
private string INITLogger
{
get
{
return string.Format("{0}|{1}", this.MethodName, this.IDLogger);
}
}
}
}

View file

@ -12,6 +12,22 @@ namespace Atesa.Utilitarios
private string key = @"SOFTWARE\\Parametros";
public ObtieneParametros(string subkey = null)
{
try
{
this.key = string.IsNullOrWhiteSpace(subkey) ? this.key : string.Format(@"{0}\{1}", this.key, subkey);
RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32);
if (key.OpenSubKey(this.key) == null)
{
key.CreateSubKey(this.key, RegistryKeyPermissionCheck.ReadWriteSubTree);
}
}
catch
{
throw new Exception("The registry key 'ParametrosProcesoUltimus' does not exist and could not create it");
}
}
public void AddValueKeyRegedit(string KeyStringName, string KeyStringValue, bool Encrypt)
{
try

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net45" />
<package id="log4net" version="2.0.8" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="NLog" version="4.5.6" targetFramework="net45" />
</packages>

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff