diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js index 2c1840fec..dc614c312 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js @@ -121,55 +121,16 @@ this.toggleEnabledItem = function (id, value) { if (!confirm(msg)) { return; } - STARTREQUEST(); TableItems = $('#TableItems').DataTable(); - Item = { + EmisorPN = { IdEmisor: id, Estado: value, } var uri = CatalogosWCF + '/api/InsertarActualizarEmisor'; - var DTO = JSON.stringify(Item); - - $.ajax({ - type: 'POST', - url: uri, - cache: false, - data: DTO, - contentType: 'application/json; charset=utf-8', - dataType: 'json', - success: function (data) { - - if (data.CodigoRespuesta == "EXITOSO") { - toastr.info('Información actualizada con éxito', 'Completado'); - LimpiarControles(); - - $('#btnGuardar').hide(); - $('#btnInsertar').show(); - - TableItems.clear().draw(); - ObtenerEmisores(); - ENDREQUEST(); - } - else { - toastr.error("Ha ocurrido un error."); - ENDREQUEST(); - } - - } - }).fail(function (jqxhr, textStatus, error) { - - toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo."); - ENDREQUEST(); - - }).then(function (value) { - - ENDREQUEST(); - - }); - + AjaxPostData(uri, EmisorPN, true, true, CompletarAccion, null, null); } this.ActualizarItem = function () {