diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Aplicacion.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Aplicacion.js index 0a8d64047..cc436251e 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Aplicacion.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Aplicacion.js @@ -230,7 +230,7 @@ this.InsertarItem = function () { Descripcion: $("#txtDescripcion").val(), DescripcionLarga: $("#txtAreaDescripcionLarga").val(), IdTipoAplicacion: 1, - Estado: Estados.Inicial.Codigo + Estado: 1 } var uri = CatalogosWCF + '/api/InsertarActualizarAplicacion'; diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js index 931cd1a88..9467d39ff 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js @@ -153,7 +153,24 @@ this.ActualizarItem = function () { { return; } TableItems = $('#TableItems').DataTable(); + var repetido = false; + var data = TableItems + .rows() + .data(); + $.each(data, function (key, item) { + + if (item[2] == $("#txtDescripcion").val()) { + repetido = true + return false; + } + + }); + + if (repetido == true) { + toastr.warning('Ya existe un emisor con la misma descripción', Message_Warning); + return; + } EmisorPN = { IdEmisor: $('#hiddenId').val(), Descripcion: $('#txtDescripcion').val(), @@ -167,6 +184,7 @@ this.ActualizarItem = function () { this.InsertarItem = function () { if (ValidarPermisos('Crear catálogos').length > 0) { + if (!$("#formCatalogo").valid()) { toastr.warning("Ingresar todos los campos que son requeridos."); return false; @@ -175,11 +193,30 @@ this.InsertarItem = function () { if (!confirm("Va a ingresar un nuevo Emisor .\n ¿Desea continuar?")) { return; } - TableItems = $('#TableItems').DataTable(); + var repetido = false; + var data = TableItems + .rows() + .data(); + + $.each(data, function (key, item) { + + if (item[2] == $("#txtDescripcion").val()) { + repetido = true + return false; + } + + }); + + if (repetido == true) { + toastr.warning('Ya existe un emisor con la misma descripción', Message_Warning); + return; + } + EmisorPN = { IdTipoEmisor : 1, Descripcion: $("#txtDescripcion").val(), + Estado: 1 } var uri = CatalogosWCF + '/api/InsertarActualizarEmisor'; diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js index 1fdb46624..9bc48bf00 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js @@ -78,7 +78,7 @@ this.CargarTareasPendientes = function () { var uri = SinortWCF + '/api/ObtenerTareasPendientes'; var model = { - codigo: 'josnunez' + codigo: UsuarioSistema } diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml index 700f0c636..3b4ebee4b 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Aplicacion.cshtml @@ -58,7 +58,7 @@
| Catalogo | +Catálogo | Acción |
|---|