From 18310f9dd6ccc07c7777e9bc9379dd40617d28cf Mon Sep 17 00:00:00 2001 From: jnunez Date: Fri, 17 Aug 2018 23:27:51 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C429 --- .../AYA.SlnSynor/Sinort-Scripts/Aplicacion.js | 2 +- .../AYA.SlnSynor/Sinort-Scripts/EmisorPN.js | 39 ++++++++++++++++++- .../Sinort-Scripts/TareasPendientes.js | 2 +- .../Views/Catalogos/Aplicacion.cshtml | 4 +- .../Views/Catalogos/Mantenimiento.cshtml | 2 +- 5 files changed, 43 insertions(+), 6 deletions(-) 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 @@
- +
@@ -66,7 +66,7 @@ @*--------------------- Descripcion Larga ---------------------------------------------------------*@
- +
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Mantenimiento.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Mantenimiento.cshtml index 54561377b..fe4510770 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Mantenimiento.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Mantenimiento.cshtml @@ -19,7 +19,7 @@ - +