From 6fc0a29384c8f4db5a44f7a39b7f1e2d6919573c Mon Sep 17 00:00:00 2001 From: jmoya Date: Thu, 12 Jul 2018 16:28:02 +0000 Subject: [PATCH] cambios git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C211 --- AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs | 3 + .../AYA.SlnSynor.WCF/ISinortCatalogos.cs | 9 -- .../AYA.SlnSynor.WCF/SinortCatalogos.svc.cs | 35 -------- .../FichaTecnica.js | 88 +++++++++++++++---- .../FichaTecnica.cshtml | 40 +++++++++ .../Sinort/DocumentosAdjuntosDAL.cs | 19 ++++ 6 files changed, 131 insertions(+), 63 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs index 93188b6f1..bb40f2384 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs @@ -45,6 +45,7 @@ namespace AYA.SlnSinort.WCF [OperationContract] FichaTecnicaJSON GuardarFichaTecnicaPalabraClave(FichaTecnicaJSON model); #endregion + #region Adjuntos [OperationContract] AdjuntosJSON RemoverAdjunto(AdjuntosJSON model); @@ -54,6 +55,8 @@ namespace AYA.SlnSinort.WCF [OperationContract] List ObtenerAdjuntos(AdjuntosJSON model); + + #endregion #region Tareas Pendientes diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs index 980eb7fb0..29f9c5b1f 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs @@ -95,15 +95,6 @@ namespace AYA.SlnSinort.WCF Task ActualizarUsuarios(UsuariosAyAJSON model); #endregion - //#region Estado - - //[OperationContract] - //List ObtenerEstado(); - - //[OperationContract] - //List ObtenerEstadoPopUp(CatalogosPost model); - //#endregion - #region PropuestaNormativa [OperationContract] ProyectoNormativoJSON ObtenerSitios(AtesaJSON model); diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs index b3ac27a2b..23b50e5eb 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs @@ -242,41 +242,6 @@ namespace AYA.SlnSinort.WCF } #endregion - //#region Estado - //public List ObtenerEstado() - //{ - // List respuesta = null; - // try - // { - // respuesta = new EstadoDAL().ObtenerEstado(); - - // } - // catch (Exception ex) - // { - // log.Error(ex); - // } - // return respuesta; - //} - - //public List ObtenerEstadoPopUp(CatalogosPost model) - //{ - // List respuesta = new List(); - // CatalogosPostJSON CatalogosPostJSON = new CatalogosPostJSON(); - // CatalogosPostJSON.filtro = model.filtro; - // CatalogosPostJSON.IdTipo = model.IdTipo; - // try - // { - - // respuesta = new EstadoDAL().ObtenerEstado(CatalogosPostJSON); - - // } - // catch (Exception ex) - // { - // log.Error(ex); - // } - // return respuesta; - //} - //#endregion #region RolesUsuarios diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/FichaTecnica.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/FichaTecnica.js index be5f34042..8006efd91 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/FichaTecnica.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/FichaTecnica.js @@ -6,18 +6,19 @@ var IdFichaTecnica; jQuery(document).ready(function () { getDataModel(); + $('#txtEstadoDocumento').val('Activo'); }); this.getDataModel = function () { CargarEmisor(); CargarAplicacion(); + CargarNombreDocumento(); CargarContenido(); CargarGrupoTematico(); CargarSubCategoriaContenido(); CargarSubCategoriaGrupoTematico(); CargarDocumentoTecnico(); //CargarPalabraClave(); - //CargarEstado(); //$("#btnBuscarPalabraClave").unbind("click"); //$("#btnBuscarPalabraClave").click(function () { @@ -29,24 +30,6 @@ this.getDataModel = function () { // AgregarUsuario(); //}); - $("#btnBuscarEmisor").unbind("click"); - $("#btnBuscarEmisor").click(function () { - - SelectedCatalog = 'Emisor'; - - if ($.fn.DataTable.isDataTable('#tableEmisor')) { - - LoadMessage(); - - $('#tableEmisor').DataTable().search('').draw(); - - $('#modalEmisor').modal('show'); - - ENDREQUEST(); - - } - }); - $("#btnBuscarAplicacion").unbind("click"); $("#btnBuscarAplicacion").click(function () { @@ -83,6 +66,25 @@ this.getDataModel = function () { } }); + + $("#btnBuscarNombreDocumento").unbind("click"); + $("#btnBuscarNombreDocumento").click(function () { + + SelectedCatalog = 'DocumentoTecnico'; + + if ($.fn.DataTable.isDataTable('#tableNombreDocumento')) { + + LoadMessage(); + + $('#tableNombreDocumento').DataTable().search('').draw(); + + $('#modalNombreDocumento').modal('show'); + + ENDREQUEST(); + + } + }); + $("#btnBuscarDocumentoTecnico").unbind("click"); $("#btnBuscarDocumentoTecnico").click(function () { @@ -259,6 +261,41 @@ this.CargarGridAplicacion = function (data) { } } +this.CargarNombreDocumento = function (filtro) { + + var uri = SinortWCF + '/api/ObtenerAdjuntos'; + var model = { + IdTipo: 1, + filtro: filtro == null ? '' : '&filtro=' + filtro + } + + AjaxPostData(uri, model, false, false, CargarGridNombreDocumento, null, null); + +} + +this.CargarGridNombreDocumento = function (data) { + + if (data != null) { + + listaNombreDocumento = data; + + var Seleccionar = $("#ucBtnSeleccionarCatalogo").html(); + + var columnDefinition = [ + { "data": null, className: "center", defaultContent: Seleccionar }, + { "data": "codigo" }, + { "data": "descripcion" } + ]; + + $('#tableNombreDocumento').TableInit(0, false, true, true, false, columnDefinition, listaNombreDocumento, false); + } + + else { + + toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error); + } +} + this.CargarDocumentoTecnico = function (filtro) { var uri = CatalogosWCF + '/api/ObtenerDocumentoTecnicoPopUp'; @@ -469,6 +506,19 @@ $('#tableEmisor').on('click', 'button', function () { }); +$('#tableNombreDocumento').on('click', 'button', function () { + + var data = $('#tableNombreDocument').DataTable().row($(this).parents('tr')).data(); + + if (SelectedCatalog == "NombreDocument") { + + $('#hiddenDNombreDocument').val(data.codigo); + $('#txtNombreDocument').val(data.descripcion); + } + $('#modalNombreDocument').modal('hide'); + +}); + $('#tableDocumentoTecnico').on('click', 'button', function () { var data = $('#tableDocumentoTecnico').DataTable().row($(this).parents('tr')).data(); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/FichaTecnica.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/FichaTecnica.cshtml index a2c0d447f..f1ec2866c 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/FichaTecnica.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/FichaTecnica.cshtml @@ -263,6 +263,46 @@ @section Modals{ + +@*---------------------Catalogo Nombre Documento Tecnico---------------------------------------------------------*@ + + @*---------------------Catalogo Emisor---------------------------------------------------------*@