From daff486e3d7abb2fb2751168c5b93b6ea266ebb0 Mon Sep 17 00:00:00 2001 From: jnunez Date: Mon, 9 Jul 2018 16:23:08 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C177 --- AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js | 13 ++++++++----- .../AYA.SlnSynor/Views/Catalogos/Rol.cshtml | 2 +- .../AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js index 64d02cf9d..500184cef 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Rol.js @@ -307,7 +307,7 @@ this.GuardarRolesPantallas = function () { if (!confirm("Va registrar las opciones asociadas.\n ¿Desea continuar?")) { return; } - GridRolesOpciones = $('#GridRolesUsuarios').DataTable(); + GridRolesOpciones = $('#GridRolesOpciones').DataTable(); var IdRoles = $('#hiddenIdRol').val(); var ArrayRolesOpciones= []; var data = GridRolesOpciones @@ -316,12 +316,15 @@ this.GuardarRolesPantallas = function () { $.each(data, function (key, item) { + + var estado = item[1] == 0 ? true : false + RolesPantallas = { IdRolesPantallas: item[1], IdRol: IdRoles, - Descripcion: item[2], - Estado: true + IdPantalla: item[2], + Estado: estado } ArrayRolesOpciones.push(RolesPantallas); @@ -329,7 +332,7 @@ this.GuardarRolesPantallas = function () { var uri = CatalogosWCF + '/api/InsertarActualizarRolesPantallas'; var model = { - ListaRolesPantallas: ArrayRolesPantallas + ListaRolesPantallas: ArrayRolesOpciones }; AjaxPostData(uri, model, false, true, null, null, null); @@ -363,7 +366,7 @@ this.HabilitarOpcion = function (id, value) { ArrayRolesPantallas.push(RolesPantallas); var model = { - ListaRolesPantallas: RolesPantallas + ListaRolesPantallas: ArrayRolesPantallas } diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml index 9cee8ffeb..45405e265 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Rol.cshtml @@ -203,7 +203,7 @@ diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs index a8cf629ae..79c0a94a5 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs @@ -147,6 +147,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort model.FechaModificacion = DateTime.Now; model.FechaCreacion = Actual.FechaCreacion; model.UsuarioCreacion = Actual.UsuarioCreacion; + model.IdPantalla = Actual.IdPantalla; + model.IdRol = Actual.IdRol; Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached; Conn.RolesPantallas.Attach(model); Conn.Entry(model).State = System.Data.Entity.EntityState.Modified;