diff --git a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj index bd662c36c..d83e8be30 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj +++ b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj @@ -7715,7 +7715,7 @@ - + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js index 4396e7248..e2295c42d 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js @@ -1,146 +1,82 @@ -// Cargando Catalogo Nacionalidad - -var tableResultadoCatalogo = $('#tableResultadoCatalogo').DataTable(); + -this.TableNacionalidad_OnLoad = function () { +this.CargarEmisor = function (filtro) { - var uri = 'api/SolicitudAPI/ObtenerNacionalidad/'; + var uri = CatalogosWCF + '/api/ObtenerEmisor?IdTipoEmisor=1' + (filtro == null ? '' : '&filtro=' + filtro); - var UI = new Ultimus.UI(); - $.getJSON(server + uri).done(function (data) { - if (data != null) { + $.getJSON(server + uri).done(function (data) { - for (var i = 0; i <= data.length - 1; ++i) { + if (data != null) { - var Seleccionar = $("#ucBtnSeleccionar").html(); - Seleccionar = Seleccionar.replace("[$id]", data[i].na_codigo); - Seleccionar = Seleccionar.replace("[$description]", data[i].na_descripcion); - Seleccionar = Seleccionar.replace("[$controlID]", "#hiddenCodNacionalidad"); - Seleccionar = Seleccionar.replace("[$controlDescription]", "#txtNacionalidad"); - Seleccionar = Seleccionar.replace("[$modal]", "#modalAgregarDescripcion"); - Seleccionar = Seleccionar.replace("[$form]", "#formConsulta"); + listaEmisor = data; - tableResultadoCatalogo.row.add([Seleccionar, data[i].na_codigo, data[i].na_descripcion]).draw(); + var Seleccionar = $("#ucBtnSeleccionarCatalogo").html(); + + var columnDefinition = [ + { "data": null, className: "center", defaultContent: Seleccionar }, + { "data": "codigo" }, + { "data": "descripcion" } + ]; + + $('#tableCatalogo').TableInit(0, false, true, false, false, columnDefinition, listaEmisor, false); } - $("#formAgregarDescripcion").find('.dataTables_filter input').val(''); - tableResultadoCatalogo.search('').draw(); + else { - $('#modalAgregarDescripcion').modal('show'); + toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error); + } + + }).fail(function (jqxhr, textStatus, error) { UI.ENDREQUEST(); - } - else { + toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error); - } - }).fail(function (jqxhr, textStatus, error) { + }).then(function (value) { + UI.ENDREQUEST(); + }); + +} - toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error); +$("#btnBuscarLugarTrabajo").click(function () { - }).then(function (value) { + var uri = 'api/SolicitudAPI/ObtenerLugarTrabajo?cod_solicitud=' + $("#hiddensol_co_solicitud").val(); + + SelectedCatalog = "ObtenerLugarTrabajo"; + + if ($.fn.DataTable.isDataTable('#tableEmpresas')) { + + LoadMessage(); + + $('#tableEmpresas').DataTable().search('').draw(); + + $('#modalEmpresas').modal('show'); UI.ENDREQUEST(); - }); -} -$("#tableResultadoCatalogo tbody td").live("click", "td", function (event) { + } + else { + + var Seleccionar = $("#ucBtnSeleccionar").html(); + + var columnDefinition = [ + { "data": null, className: "center", defaultContent: Seleccionar }, + { "data": "em_codigo" }, + { "data": "em_descripcion" } + ]; + + $('#tableEmpresas').TableInit(0, false, true, false, false, columnDefinition, listaLugarTrabajo); + + //$('#tableEmpresas').DataTable().search($("#txtLugarTrabajo").val()).draw(); + + $('#modalEmpresas').modal('show'); + + UI.ENDREQUEST(); - var data = $('#tableResultadoCatalogo').DataTable().row($(this).parents('tr')).data(); - if (SelectedCatalog == "PROVINCIA") { - if ($('#hiddenCodProvincia').val() == "10" || $('#hiddenCodProvincia').val() == "11" || $('#hiddenCodProvincia').val() == "12") { - $('#txtDistrito').noRequired(); - $('#btnBuscarDistrito').disable(); - $('#btnBuscarCorregimiento').disable(); - } } - $("#formDatosResidenciales").valid(); - $("#formDatosGenerales").valid(); - - $('#modalAgregarDescripcion').modal('hide'); -}); - -/* - -
- -
- - -
-
- -
-
- - - -@section Modals{ - - - -} -*/ \ No newline at end of file +}); \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/PopUp/_Catalogo.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/PopUp/_Catalogo.cshtml new file mode 100644 index 000000000..986dffcd3 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/PopUp/_Catalogo.cshtml @@ -0,0 +1,55 @@ + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml index ab96d8491..09cf6229d 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml @@ -12,7 +12,7 @@
  

 Propuesta Normativa

-
+ @*
*@
@@ -164,11 +164,140 @@
-
+ @*
*@
+@**@ + + +@section Modals{ + +@*---------------------CatalogoEmisor---------------------------------------------------------*@ + + + +@*---------------------CatalogoAplicacion---------------------------------------------------------*@ + +} @section scripts{ @Scripts.Render("~/Scripts/Sinort-PropuestaNormativa") diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Catalogo.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Catalogo.cshtml deleted file mode 100644 index 5f282702b..000000000 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Catalogo.cshtml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml index babc3da9c..c4934b4d0 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml @@ -50,6 +50,8 @@
+ @RenderSection("Modals", required: false) +
diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/EmisorDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/EmisorDAL.cs index 25b77a5a0..daf3d77fb 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/EmisorDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/EmisorDAL.cs @@ -21,12 +21,13 @@ namespace AYA.SlnSinortModel.DAL.Sinort { List registros = null; string filtro = model != null ? model.filtro : null; + int? IdTipoEmisor = model != null ? model.IdTipo : null; try { using (SinortContex db = new SinortContex()) { - registros = db.Emisor.Where(t => t.Estado == true && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()))) + registros = db.Emisor.Where(t => t.Estado == true && t.IdTipoEmisor == IdTipoEmisor &&(string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()))) .Select(t => new CatalogosJSON() { codigo = t.IdEmisor.ToString(), diff --git a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/CatalogosJSON.cs b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/CatalogosJSON.cs index 3a1ca3532..1a2f73b06 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/CatalogosJSON.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/CatalogosJSON.cs @@ -19,6 +19,8 @@ namespace AYA.SlnSinortModel.Entidades public object dataModel { get; set; } public string codigo { get; set; } public string filtro { get; set; } + + public int? IdTipo { get; set; } } public class RolesPantallasJSON : BaseJson