From c4093b8f28e73e7c9260ce8770802efe8f7cf4e9 Mon Sep 17 00:00:00 2001 From: jnunez Date: Thu, 7 Jun 2018 22:31:31 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C8 --- AYA.SlnSynor/AYA.SlnSynor.WCF/Web.config | 8 +- AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSynor.csproj | 2 + .../AYA.SlnSynor/App_Start/BundleConfig.cs | 5 +- .../AYA.SlnSynor/Content/Principal.css | 147 ++++++++ .../easyui/themes/bootstrap/easyui.css | 17 +- .../AYA.SlnSynor/Scripts/_references.js | Bin 587372 -> 585438 bytes .../Sinort-Scripts/AdministrarCatalogos.js | 18 +- .../AYA.SlnSynor/Sinort-Scripts/EmisorPN.js | 334 ++++++++++++++++++ .../AYA.SlnSynor/Sinort-Scripts/Global.js | 66 ++++ .../Views/Catalogos/EmisorPN.cshtml | 133 ++++--- .../AYA.SlnSynor/Views/Home/Index.cshtml | 8 +- .../Normativa_Reglamentacion_Tecnica.cshtml | 2 +- .../AYA.SlnSynor/Views/Shared/_Layout.cshtml | 43 ++- 13 files changed, 692 insertions(+), 91 deletions(-) create mode 100644 AYA.SlnSynor/AYA.SlnSynor/Content/Principal.css create mode 100644 AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/Web.config b/AYA.SlnSynor/AYA.SlnSynor.WCF/Web.config index f83ee8e7d..3e1d999b9 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/Web.config +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/Web.config @@ -43,7 +43,7 @@ - + @@ -65,11 +65,7 @@ - - - - - + diff --git a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSynor.csproj b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSynor.csproj index d8d46e99a..de3bb0dea 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSynor.csproj +++ b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSynor.csproj @@ -6950,6 +6950,7 @@ + @@ -8039,6 +8040,7 @@ + diff --git a/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs b/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs index cca76494c..29106174c 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs +++ b/AYA.SlnSynor/AYA.SlnSynor/App_Start/BundleConfig.cs @@ -52,8 +52,9 @@ namespace AYA.SlnSynor .Include("~/Scripts/jquery.easyui.min.js") .Include("~/Scripts/locale/easyui-lang-es.js")); - bundles.Add(new ScriptBundle("~/Script-Catalogos").Include( - "~/Sinort-Scripts/AdministrarCatalogos.js")); + bundles.Add(new ScriptBundle("~/Script-Catalogos") + .Include("~/Sinort-Scripts/AdministrarCatalogos.js") + .Include("~/Sinort-Scripts/EmisorPN.js")); } } diff --git a/AYA.SlnSynor/AYA.SlnSynor/Content/Principal.css b/AYA.SlnSynor/AYA.SlnSynor/Content/Principal.css new file mode 100644 index 000000000..bc801a1a7 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Content/Principal.css @@ -0,0 +1,147 @@ + + + +.menu_bar { + display:none; + text-align :right ; +} + +header { + width: 100%; + + +} +header a:visited { + color: #414042; +} + +header a:hover { + color: #0055aa; +} + +header nav { + background:#E6E7E8; + + + +} + +header nav ul { + list-style:none; + padding:0; + margin:0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +header ul + li { + margin-top: 0px; +} + + + +header ul { + margin-top: 0px; + margin-bottom: 0px; + +} +header nav ul li { + display:inline-block; + position: relative; + font-family: Arial, sans-serif; + font-size: 11pt; + font-weight :bold; +} + +header nav ul li:hover { + color:red; +} + +header nav ul li a { + color:#414042; + display:block; + text-decoration:none; + padding: 20px; + + +} +header nav ul li a:hover { + color:#0055aa; +} +header nav ul li a span { + margin-right:0px; +} + +header nav ul li:hover .children { + display:block; +} + +header nav ul li .children { + display: none; + background:#E6E7E8; + position: absolute; + width: 100%; + z-index:1000; +} + +header nav ul li .children li { + display:block; + overflow: hidden; + border-bottom: 1px solid rgba(255,255,255,.5); +} + +header nav ul li .children li a { + display: block; +} + +header nav ul li .children li a span { + float: right; + position: relative; + top:3px; + margin-right:0; + margin-left:0px; +} + +header nav ul li .caret { + position: relative; + top:3px; + margin-left:0px; + margin-right:0px; +} + .show-menu { + font-family: Arial, sans-serif; + text-decoration: none; + color: #fff; + background: #0055aa; + text-align: center; + padding: 10px 0; + display: none; +} + +input[type=checkbox]{ + display: none; +} +input[type=checkbox]:checked ~ #menuprincipal{ + display: block; +} +@media screen and (max-width: 800px) { + nav ul { + position: static; + display: none; + margin :0 50px 0 0; + align-items :center ; + } + /*Create vertical spacing*/ + nav li { + margin-bottom: 1px; + padding: 0 0 0 0; + } + /*Make all menu links full width*/ + nav ul li, li a { + width: 100%; + text-align: left; + } + .show-menu { + display:block; + } +} \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Content/easyui/themes/bootstrap/easyui.css b/AYA.SlnSynor/AYA.SlnSynor/Content/easyui/themes/bootstrap/easyui.css index 3d06d4060..ac7f52105 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Content/easyui/themes/bootstrap/easyui.css +++ b/AYA.SlnSynor/AYA.SlnSynor/Content/easyui/themes/bootstrap/easyui.css @@ -124,9 +124,10 @@ background-color: #ffffff; color: #333; font-size: 12px; + } .panel-title { - font-size: 15px; + font-size: 12px; font-weight: bold; color: #777; height: 20px; @@ -807,7 +808,7 @@ border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { - font-size: 18px; + font-size: 12px; border: 0; margin: 0; padding: 0 4px; @@ -832,7 +833,7 @@ white-space: pre-wrap; } .textbox .textbox-prompt { - font-size: 18px; + font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { @@ -1377,7 +1378,7 @@ margin-top: -8px; } .tabs-title { - font-size: 18px; + font-size: 12px; } .tabs-closable { padding-right: 8px; @@ -1753,13 +1754,13 @@ overflow: hidden; height: 18px; line-height: 18px; - font-size: 150%; + font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { - font-size: 100%; + font-size: 12px; } .datagrid-cell-group { text-align: center; @@ -1837,7 +1838,7 @@ margin: 0; padding: 2px 4px; border: 1px solid #D4D4D4; - font-size: 100%; + font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; @@ -2083,7 +2084,7 @@ width: 3em; height: auto; text-align: center; - font-size: 100%; + font-size: 12px; } .pagination-page-list { margin: 0px 6px; diff --git a/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js b/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js index 93645dcf1accc464740df0645696a2782f6ee3fb..f6b0f2b4eebc02b7a14d20a13d59d174e4901872 100644 GIT binary patch delta 378 zcmaF!M)}@d<%Sl<7N!>F7M2#)7Pc1lEgWeNr*F8)AuxTxLym;$Mo&1@rl&pPaDcFQ z9>Z8h+Du@vG>F8%CoqX6Phl*tXE4?WIBVK-pjgsN4vpz{FF5SLtf?i8UeeL*it{Q_hnM*!ZRweBlt7{EX27#tCCD0m(BIPcO7# qbf0eUjYDqwoUa^NAePPK36ch2A)sNo44FXV@)?R43MMaP76kwzkCW*D delta 2365 zcmcb2SNY8w<%Sl<7N!>F7M2#)7Pc1lEgWeN)%6(k81#V{MCLH$GbA%40_hAOtC*pL z!HU70!IHs*!DRZxW6Yw{D;{#hO@1K4W=^Copqa%$6N?x!847@=6;Cg`#V$O3!xIj% z>3<$_I8e!`rVI`@D!AyxBdWPb?=jVkdcwv?4bT0eo{JKmP|0&)REd9y>3UB&?5JXt z*z_hwW@?1?kEc`$BC+Xl&!}e95$YMG^_*(1nm`q!9z5ruPI3~P9`k}~ep~d1Dw$W~ zCDmNi_mabnN_piM^<0(kifXPp^NMO=W%QbAM$LFlH4n19ff!{;W*y9+Ki%^UM<6H> w7?WYd^oOj#Dty@+jv$In5SlLbmSVp|zvb{Jx)G!Qjze+!iMJeCr0B2*0D}@5u>b%7 diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/AdministrarCatalogos.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/AdministrarCatalogos.js index fee8c770f..e5f2df7eb 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/AdministrarCatalogos.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/AdministrarCatalogos.js @@ -10,7 +10,7 @@ function IniciarForm() { IniciarGridEmisoresPN(null); btnNuevo = $("#btnNuevo").click(NuevoEmisorPN); - btnEliminar = $("#btnEliminar").click(EliminarEmisorPN); + //btnEliminar = $("#btnEliminar").click(EliminarEmisorPN); btnBuscar = $("#btnBuscar").click(function () { filtro = { @@ -115,14 +115,14 @@ function IniciarGridEmisoresPN(data) { data: data, columns: [[ //{ field: 'id_emisor', title: 'ID EMISOR', auto: true }, - { field: 'titulo', title: 'TITULO', auto: true, width: 300 }, - { - field: 'action', title: 'ACCIONES', align: 'center', haling: 'center', - formatter: function (value, row, index) { - var editar = 'Editar'; - return editar; - } - } + { field: 'titulo', title: 'TITULO', align: 'center'}, + //{ + // field: 'action', title: 'ACCIONES', align: 'center', haling: 'center', + // formatter: function (value, row, index) { + // var editar = 'Editar'; + // return editar; + // } + //} ]], pagination: true, diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js new file mode 100644 index 000000000..bcee6d631 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/EmisorPN.js @@ -0,0 +1,334 @@ +$("#formCatalogo").EnableValidationToolTip(); +var DataCatalogo; +var id_column = 1; +var Item = {}; + + +//#region READY + +jQuery(document).ready(function () { + + //GetControlsSettings("Cathay_Ejecutivo", "Cathay_Ejecutivo", "formCatalogo", true); + getDataModel(); + + +}); + +//#endregion + +this.getDataModel = function () { + + $('#txtDescripcion').attr('size', 50); + + $('#btnGuardar').hide(); + $('#btnInsertar').show(); + + + $('#btnLimpiar').click(function () { + limpiar(); + + $('#btnGuardar').hide(); + $('#btnInsertar').show(); + }); + + $('#btnGuardar').click(function () { + ActualizarItem(); + }); + + $('#btnInsertar').click(function () { + InsertarItem(); + }); + + + $('#btnFormalizador').unbind('click'); + $('#btnFormalizador').click(function () { + SelectedCatalog = "Formalizador"; + CargarDataCatalogo($('#btnFormalizador').attr('direccion_api'), null, "1"); + }); + + + obtenerItems(); + + +} + +this.obtenerItems = function () { + + + var uri = CatalogosWCF + '/api/ObtenerEmisoresPN'; + + $.getJSON(server + uri).done(function (data) { + + $('#TableItems').TableInit(0, false, true, true, false, null, null); + + var TableItems = $('#TableItems').DataTable(); + + $.each(data, function (key, item) { + + + var option = $("#ucItemsCatalogo").html(); + + option = replaceAll("[$CodItem]", item.IdEjecutivo, option); + + var stateIcon = $("#ucItemsIcon").html(); + + if (item.Estado == false) { + stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon); + stateIcon = replaceAll("[$state_color]", "muted", stateIcon); + + option = replaceAll("[$opcion]", "Habilitar", option); + option = replaceAll("[$icon]", "fa-check", option); + option = replaceAll("[$value]", "1", option); + } + else { + stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon); + stateIcon = replaceAll("[$state_color]", "success", stateIcon); + + option = replaceAll("[$opcion]", "Deshabilitar", option); + option = replaceAll("[$icon]", "fa-times", option); + option = replaceAll("[$value]", "0", option); + } + + TableItems.row.add([stateIcon, + item.IdTipoEmisor, + item.Descripcion, + option]).draw(); + + }); + + + + ENDREQUEST(); + + }).fail(function (jqxhr, textStatus, error) { + + toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde"); + + console.log("Request Failed: " + textStatus + ', ' + error); + + ENDREQUEST(); + + }).then(function (value) { + + ENDREQUEST(); + }); + +} + +this.EditarItem = function (id) { + + TableItems = $('#TableItems').DataTable(); + limpiar(); + var indexes = getRowIndex(TableItems, id_column, id); + + if (indexes != null) { + + $('#hiddenId').val(id) + $('#txtDescripcion').val(TableItems.cell(indexes, 2).data()); + + + + $("#formCatalogo").validateElement("#txtDescripcion"); + + + $('#lbTituloAccion').empty(); + $('#lbTituloAccion').append('Editar Valor de Campo ID: ' + id); + + $('#btnInsertar').hide(); + $('#btnGuardar').show(); + } + + +} + +this.toggleEnabledItem = function (id, value) { + + var msg = '¿Está seguro que desea habilitar el Emisor PN?'; + + if (value == 0) { + msg = '¿Está seguro que desea deshabilitar el Emisor PN?'; + } + + if (id == null || value == null) { + toastr.warning("No se pudo obtener el ID del Emisor PN seleccionado."); + return; + } + + if (!confirm(msg)) + { return; } + + + TableItems = $('#TableItems').DataTable(); + + Item = { + IdEjecutivo: id, + Estado: value, + UsuarioModificado: $("#hiddenUserID").val() + + } + + var uri = 'api/EjecutivoAPI/toggleStateItem/'; + var DTO = JSON.stringify(Item); + + $.ajax({ + type: 'POST', + url: server + uri, + cache: false, + data: DTO, + contentType: 'application/json; charset=utf-8', + dataType: 'json', + success: function (data) { + + if (data == "EXITOSO") { + toastr.info('Información actualizada con éxito', 'Completado'); + limpiar(); + + $('#btnGuardar').hide(); + $('#btnInsertar').show(); + + TableItems.clear().draw(); + obtenerItems(); + 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(); + + }); + +} + +this.ActualizarItem = function () { + + if (!$("#formCatalogo").valid()) { + toastr.warning("Ingresar todos los campos que son requeridos."); + return false; + } + + if (!confirm("Se guardarán los cambios.\n ¿Desea continuar?")) + { return; } + + TableItems = $('#TableItems').DataTable(); + + Item = { + IdTipoEmisor: $('#hiddenId').val(), + Descripcion: $('#txtDescripcion').val(), + } + + var uri = CatalogosWCF + '/api/ModificarEmisoresPN'; + var DTO = JSON.stringify(Item); + + $.ajax({ + type: 'POST', + url: server + uri, + cache: false, + data: DTO, + contentType: 'application/json; charset=utf-8', + dataType: 'json', + success: function (data) { + + if (data == "EXITOSO") { + toastr.info('Información guardada con éxito', 'Completado'); + limpiar(); + + $('#btnGuardar').hide(); + $('#btnInsertar').show(); + + $('#lbTituloAccion').empty(); + $('#lbTituloAccion').append('Ingresar Nuevo Emisor PN'); + + TableItems.clear().draw(); + obtenerItems(); + 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(); + }); +} + +this.InsertarItem = function () { + + + if (!$("#formCatalogo").valid()) { + toastr.warning("Ingresar todos los campos que son requeridos."); + return false; + } + + if (!confirm("Va a ingresar un nuevo Emisor PN.\n ¿Desea continuar?")) + { return; } + + TableItems = $('#TableItems').DataTable(); + + Ejecutivo = { + Descripcion: $("#txtDescripcion").val(), + } + + var uri = CatalogosWCF + '/api/InsertarEmisorPN'; + var DTO = JSON.stringify(Ejecutivo); + + $.ajax({ + type: 'POST', + url: server + uri, + cache: false, + data: DTO, + contentType: 'application/json; charset=utf-8', + dataType: 'json', + success: function (data) { + + if (data == "EXITOSO") { + toastr.info('Información guardada con exito', 'Completado'); + limpiar(); + $('#btnGuardar').hide(); + $('#btnInsertar').show(); + + TableItems.clear().draw(); + obtenerItems(); + 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(); + }); +} + +this.limpiar = function () { + + $('#txtDescripcion').val(''); + $("#formCatalogo").validateElement("#txtDescripcion"); +} + + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js index 050990432..df797e0f4 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js @@ -132,4 +132,70 @@ function STARTREQUEST (Message) { function ENDREQUEST() { $("#loadingGif").hide(); +}; + +$.fn.TableInit = function (columnOrder, order, bPaginate, bFilter, bInfo, columnDefinition, data) { + + var ES = { + "sProcessing": "Procesando...", + "sLengthMenu": "Mostrar _MENU_ registros", + "sZeroRecords": "No se encontraron resultados", + "sEmptyTable": "Ningún dato disponible", + "sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros", + "sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", + "sInfoFiltered": "(filtrado de un total de _MAX_ registros)", + "sInfoPostFix": "", + "sSearch": "Buscar:", + "sUrl": "", + "sInfoThousands": ",", + "sLoadingRecords": "Cargando...", + "oPaginate": { + "sFirst": "Primero", + "sLast": "Último", + "sNext": "Siguiente", + "sPrevious": "Anterior" + }, + "oAria": { + "sSortAscending": ": Activar para ordenar la columna de manera ascendente", + "sSortDescending": ": Activar para ordenar la columna de manera descendente" + } + }; + + var EN = { + "sProcessing": "Processing...", + "sLengthMenu": "Show _MENU_ registers", + "sZeroRecords": "No results found", + "sEmptyTable": "No data available", + "sInfo": "Showing registers from _START_ to _END_ of a total of _TOTAL_ registers", + "sInfoEmpty": "Showing registers from 0 to 0 of a total of 0 registers", + "sInfoFiltered": "(filtering of a total of _MAX_ registers)", + "sInfoPostFix": "", + "sSearch": "Find:", + "sUrl": "", + "sInfoThousands": ",", + "sLoadingRecords": "Loading...", + "oPaginate": { + "sFirst": "First", + "sLast": "Last", + "sNext": "Next", + "sPrevious": "Previous" + }, + "oAria": { + "sSortAscending": ": Activate to sort the column in ascending order", + "sSortDescending": ": Activate to sort the column in descending order" + } + }; + + this.dataTable({ + "language": EN, + "order": [[columnOrder, order]], + "destroy": true, + "bPaginate": bPaginate, + "bFilter": bFilter, + "bInfo": bInfo, + "data": data, + "columns": columnDefinition, + "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], + + }); }; \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml index f41b4be9a..075e39580 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/EmisorPN.cshtml @@ -1,70 +1,93 @@ @{ ViewBag.Title = "EmisorPN"; Layout = "~/Views/Shared/_Layout.cshtml"; + } -@Styles.Render("~/Content/sinort-css") +
+
+