git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C54
This commit is contained in:
parent
7206edbdec
commit
1527108933
2 changed files with 9 additions and 9 deletions
|
|
@ -7,15 +7,17 @@ using System.Threading.Tasks;
|
||||||
using System.Data.Entity;
|
using System.Data.Entity;
|
||||||
using System.Data.Entity.Validation;
|
using System.Data.Entity.Validation;
|
||||||
using AYA.SlnSinortModel.Entidades;
|
using AYA.SlnSinortModel.Entidades;
|
||||||
|
using Atesa.Utilitarios;
|
||||||
|
|
||||||
namespace AYA.SlnSinortModel.DAL.Sinort
|
namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
public class PantallasDAL
|
public class PantallasDAL
|
||||||
{
|
{
|
||||||
|
Log log = new Log("PantallasDAL");
|
||||||
|
|
||||||
public List<Pantallas> ObtenerPantallas(CatalogosPostJSON model)
|
public List<Pantallas> ObtenerPantallas(CatalogosPostJSON model)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
List<Pantallas> registros = null;
|
List<Pantallas> registros = null;
|
||||||
string filtro = model != null ? model.filtro : null;
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
|
|
@ -28,7 +30,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//log.Error(ex);
|
log.Error(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return registros;
|
return registros;
|
||||||
|
|
@ -44,7 +46,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
using (SinortContex db = new SinortContex())
|
using (SinortContex db = new SinortContex())
|
||||||
{
|
{
|
||||||
|
|
||||||
if (model == null && !string.IsNullOrWhiteSpace(model.codigo))
|
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||||
{
|
{
|
||||||
if (!db.RolesPantallas.Any(r => r.IdRol.ToString() == model.codigo))
|
if (!db.RolesPantallas.Any(r => r.IdRol.ToString() == model.codigo))
|
||||||
{
|
{
|
||||||
|
|
@ -60,14 +62,14 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
registros = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(p => p.Pantallas).AsNoTracking().ToList();
|
registros = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(p => p.Pantallas).OrderBy(r => r.IdPantalla).AsNoTracking().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//log.Error(ex);
|
log.Error(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return registros;
|
return registros;
|
||||||
|
|
|
||||||
|
|
@ -158,12 +158,12 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
}
|
}
|
||||||
catch (DbEntityValidationException ex)
|
catch (DbEntityValidationException ex)
|
||||||
{
|
{
|
||||||
//logger.Error(exs);
|
log.Error(ex);
|
||||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//logger.Error(ex);
|
log.Error(ex);
|
||||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
@ -173,8 +173,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
return Respuesta;
|
return Respuesta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue