From 15271089336167efb284e918af3642a2edaa0233 Mon Sep 17 00:00:00 2001 From: mumana Date: Fri, 15 Jun 2018 15:55:41 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C54 --- .../AYA.SlnSynorModel.DAL/Sinort/PantallasDAL.cs | 12 +++++++----- .../AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs | 6 ++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/PantallasDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/PantallasDAL.cs index bf978cea3..06c2bb0f8 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/PantallasDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/PantallasDAL.cs @@ -7,15 +7,17 @@ using System.Threading.Tasks; using System.Data.Entity; using System.Data.Entity.Validation; using AYA.SlnSinortModel.Entidades; +using Atesa.Utilitarios; namespace AYA.SlnSinortModel.DAL.Sinort { public class PantallasDAL { + Log log = new Log("PantallasDAL"); + public List ObtenerPantallas(CatalogosPostJSON model) { - List registros = null; string filtro = model != null ? model.filtro : null; @@ -28,7 +30,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort } catch (Exception ex) { - //log.Error(ex); + log.Error(ex); } return registros; @@ -44,7 +46,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort 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)) { @@ -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) { - //log.Error(ex); + log.Error(ex); } return registros; diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs index ef0c1caf6..a8cf629ae 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs @@ -158,12 +158,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 @@ -173,8 +173,6 @@ namespace AYA.SlnSinortModel.DAL.Sinort return Respuesta; } - - #endregion } }