From 8ae6de7da4a01c9beeb0744b8a973e20e3148ac1 Mon Sep 17 00:00:00 2001 From: jnunez Date: Thu, 14 Jun 2018 23:07:46 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C51 --- .../AYA.SlnSynor/Sinort-Scripts/Rol.js | 16 +++-- .../Views/Catalogos/Aplicacion.cshtml | 12 +++- .../Views/Catalogos/EmisorPN.cshtml | 8 +-- .../AYA.SlnSynor/Views/Catalogos/Rol.cshtml | 69 ++++++++++++++++++- .../AYA.SlnSynor/Views/Shared/_Layout.cshtml | 63 +++++++++++------ .../AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs | 15 ++-- 6 files changed, 140 insertions(+), 43 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js index 84b5eb9f2..f90b3fb41 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js @@ -58,7 +58,7 @@ this.CargarGridRoles = function (data) { var usuarios = $("#ucbtnVistaUsuarios").html(); option = replaceAll("[$CodItem]", item.IdRol, option); pantallas = replaceAll("[$CodItem]", item.IdRol, pantallas); - + usuarios = replaceAll("[$CodItem]", item.IdRol, usuarios); var stateIcon = $("#ucItemsIcon").html(); if (item.Estado == false) { @@ -247,7 +247,8 @@ this.CargarTablaPantallas = function (data) { checkbox = replaceAll("[$id]", item.IdPantalla, checkbox); checkbox = replaceAll("[$check]", item.Estado != true ? "" : "checked", checkbox); - TableItems.row.add([item.IdPantalla, + TableItems.row.add([item.IdRolesPantallas, + item.IdPantalla, item.Pantallas.Descripcion, checkbox]).draw(); }); @@ -258,7 +259,7 @@ this.CargarTablaPantallas = function (data) { this.GuardarRolesPantallas = function () { - if (!confirm("Va registrar las pantallas.\n ¿Desea continuar?")) + if (!confirm("Va registrar las pantallas asociadas.\n ¿Desea continuar?")) { return; } TablePantallas = $('#GridRolesPantallas').DataTable(); @@ -275,6 +276,7 @@ this.GuardarRolesPantallas = function () { RolesPantallas = { + IdRolesPantallas:IdRolesPantallas, IdRol: IdRoles, IdPantalla: item[0], Estado: cheched @@ -294,7 +296,9 @@ this.GuardarRolesPantallas = function () { ENDREQUEST(); - - - } + +this.AbrirRolesUsuario = function (id) { + $("#modalRolesUsuario").modal('show'); + +} \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml index 84c29ba3b..de13063bc 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml @@ -56,7 +56,17 @@ @*Descripción*@ - + +
+ +
+ +
+
+ + + +
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml index 5a9e9f4f7..e8028c4df 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml @@ -16,9 +16,9 @@ - ID Emisor + ID Descripción - Tipo Emisor + @*Tipo Emisor*@ @@ -63,12 +63,12 @@
-
+ @*
-
+
*@
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml index 9d492dc52..dfa5c4da6 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml @@ -52,12 +52,12 @@
-
-
@@ -121,6 +121,7 @@ + @@ -144,6 +145,70 @@ + + + + + + + + + + + + + @**@ + + + + + + + + + @Scripts.Render("~/Sinort-Scripts/Rol.js") diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml index bc86be9b8..0f20ca2bc 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml @@ -195,28 +195,47 @@ @@ -369,8 +388,8 @@ @RenderSection("scripts", required: false) - \ No newline at end of file +*@ \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs index 5abefb254..627c3551b 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs @@ -134,7 +134,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort using (SinortContex Conn = new SinortContex()) { - Actual = Conn.RolesPantallas.Where(x => x.IdRol == model.IdRol && x.IdPantalla == model.IdPantalla ).FirstOrDefault(); + Actual = Conn.RolesPantallas.Where(x => x.IdRolesPantallas == model.IdRolesPantallas ).FirstOrDefault(); if (Actual == null) { int? Next_id = Conn.RolesPantallas.Max(t => (int?)t.IdRolesPantallas); @@ -144,13 +144,12 @@ namespace AYA.SlnSinortModel.DAL.Sinort } else { - //model.FechaModificacion = DateTime.Now; - //model.FechaCreacion = Actual.FechaCreacion; - //model.UsuarioCreacion = Actual.UsuarioCreacion; - //model.Descripcion = string.IsNullOrEmpty(model.Descripcion) ? Actual.Descripcion : model.Descripcion; - //Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached; - //Conn.Roles.Attach(model); - //Conn.Entry(model).State = System.Data.Entity.EntityState.Modified; + model.FechaModificacion = DateTime.Now; + model.FechaCreacion = Actual.FechaCreacion; + model.UsuarioCreacion = Actual.UsuarioCreacion; + Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached; + Conn.RolesPantallas.Attach(model); + Conn.Entry(model).State = System.Data.Entity.EntityState.Modified; } Conn.SaveChanges(); Conn.Commit();