diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs index 7dcda49f9..d0885379f 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs @@ -97,7 +97,7 @@ namespace AYA.SlnSinort.WCF #region PropuestaNormativa [OperationContract] - List ObtenerSitios(); + ProyectoNormativoJSON ObtenerSitios(); #endregion } diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs index afaffcfe6..82649c7d0 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs @@ -353,18 +353,19 @@ namespace AYA.SlnSinort.WCF #endregion #region ProyectoNormativo - public List ObtenerSitios() + public ProyectoNormativoJSON ObtenerSitios() { - List respuesta = null; + ProyectoNormativoJSON model = new ProyectoNormativoJSON(); try { - respuesta = new ProyectoNormativoDAL().ObtenerSitios(); + model = new ProyectoNormativoDAL().ObtenerSitios(); } catch (Exception ex) { + model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; log.Error(ex); } - return respuesta; + return model; } #endregion } diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js index d8feead6b..3af63ea1f 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js @@ -186,6 +186,8 @@ this.Datepicker = function (ControlId) { $(ControlId).datepicker({ yearRange: '1945:' + ((new Date).getFullYear() + 50), defaultDate: _dateObject }).datepicker('widget').wrap('
'); + $(ControlId).attr('readonly', true); + $(ControlId).css('cursor', 'pointer'); }; @@ -769,6 +771,18 @@ $.fn.noRequired = function () { }; +$.fn.readOnly = function () { + this.attr('readonly', true); + this.css('cursor', 'not-allowed'); +} + + +$.fn.noReadOnly = function () { + this.attr('readonly', false); + this.css('cursor', 'default'); +} + + $.fn.TableInit = function (columnOrder, order, bPaginate, bFilter, bInfo, columnDefinition, data) { var ES = { @@ -1650,138 +1664,4 @@ $.datepicker.regional['es'] = { showMonthAfterYear: false, yearSuffix: '' }; -$.datepicker.setDefaults($.datepicker.regional['es']); - -function getDateFromFormat(val, format) { - val = val + ""; - format = format + ""; - var i_val = 0; - var i_format = 0; - var c = ""; - var token = ""; - var token2 = ""; - var x, y; - var now = new Date(); - var year = now.getYear(); - var month = now.getMonth() + 1; - var date = 1; - var hh = now.getHours(); - var mm = now.getMinutes(); - var ss = now.getSeconds(); - var ampm = ""; - - while (i_format < format.length) { - // Get next token from format string - c = format.charAt(i_format); - token = ""; - while ((format.charAt(i_format) == c) && (i_format < format.length)) { - token += format.charAt(i_format++); - } - // Extract contents of value based on format token - if (token == "yyyy" || token == "yy" || token == "y") { - if (token == "yyyy") { x = 4; y = 4; } - if (token == "yy") { x = 2; y = 2; } - if (token == "y") { x = 2; y = 4; } - year = _getInt(val, i_val, x, y); - if (year == null) { return 0; } - i_val += year.length; - if (year.length == 2) { - if (year > 70) { year = 1900 + (year - 0); } - else { year = 2000 + (year - 0); } - } - } - else if (token == "MMM" || token == "NNN") { - month = 0; - for (var i = 0; i < MONTH_NAMES.length; i++) { - var month_name = MONTH_NAMES[i]; - if (val.substring(i_val, i_val + month_name.length).toLowerCase() == month_name.toLowerCase()) { - if (token == "MMM" || (token == "NNN" && i > 11)) { - month = i + 1; - if (month > 12) { month -= 12; } - i_val += month_name.length; - break; - } - } - } - if ((month < 1) || (month > 12)) { return 0; } - } - else if (token == "EE" || token == "E") { - for (var i = 0; i < DAY_NAMES.length; i++) { - var day_name = DAY_NAMES[i]; - if (val.substring(i_val, i_val + day_name.length).toLowerCase() == day_name.toLowerCase()) { - i_val += day_name.length; - break; - } - } - } - else if (token == "MM" || token == "M") { - month = _getInt(val, i_val, token.length, 2); - if (month == null || (month < 1) || (month > 12)) { return 0; } - i_val += month.length; - } - else if (token == "dd" || token == "d") { - date = _getInt(val, i_val, token.length, 2); - if (date == null || (date < 1) || (date > 31)) { return 0; } - i_val += date.length; - } - else if (token == "hh" || token == "h") { - hh = _getInt(val, i_val, token.length, 2); - if (hh == null || (hh < 1) || (hh > 12)) { return 0; } - i_val += hh.length; - } - else if (token == "HH" || token == "H") { - hh = _getInt(val, i_val, token.length, 2); - if (hh == null || (hh < 0) || (hh > 23)) { return 0; } - i_val += hh.length; - } - else if (token == "KK" || token == "K") { - hh = _getInt(val, i_val, token.length, 2); - if (hh == null || (hh < 0) || (hh > 11)) { return 0; } - i_val += hh.length; - } - else if (token == "kk" || token == "k") { - hh = _getInt(val, i_val, token.length, 2); - if (hh == null || (hh < 1) || (hh > 24)) { return 0; } - i_val += hh.length; hh--; - } - else if (token == "mm" || token == "m") { - mm = _getInt(val, i_val, token.length, 2); - if (mm == null || (mm < 0) || (mm > 59)) { return 0; } - i_val += mm.length; - } - else if (token == "ss" || token == "s") { - ss = _getInt(val, i_val, token.length, 2); - if (ss == null || (ss < 0) || (ss > 59)) { return 0; } - i_val += ss.length; - } - else if (token == "a") { - if (val.substring(i_val, i_val + 2).toLowerCase() == "am") { ampm = "AM"; } - else if (val.substring(i_val, i_val + 2).toLowerCase() == "pm") { ampm = "PM"; } - else { return 0; } - i_val += 2; - } - else { - if (val.substring(i_val, i_val + token.length) != token) { return 0; } - else { i_val += token.length; } - } - } - // If there are any trailing characters left in the value, it doesn't match - if (i_val != val.length) { return 0; } - // Is date valid for month? - if (month == 2) { - // Check for leap year - if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { // leap year - if (date > 29) { return 0; } - } - else { if (date > 28) { return 0; } } - } - if ((month == 4) || (month == 6) || (month == 9) || (month == 11)) { - if (date > 30) { return 0; } - } - // Correct hours value - if (hh < 12 && ampm == "PM") { hh = hh - 0 + 12; } - else if (hh > 11 && ampm == "AM") { hh -= 12; } - var newdate = new Date(year, month - 1, date, hh, mm, ss); - return newdate.getTime(); -} - +$.datepicker.setDefaults($.datepicker.regional['es']); \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js index 0e1d8f39c..1d7162b46 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js @@ -91,7 +91,6 @@ this.AgregarUsuario = function () { [participanteConfirmado, $("#hiddenUsuario").val(), $("#txtUsuario").val(), - null, moment().format('DD-MM-YYYY'), option]) .draw(); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js index 954dbcf0b..4a20cf59e 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js @@ -1,17 +1,17 @@ var SelectedCatalog = ''; +var model = {}; jQuery(document).ready(function () { - getDataModel(); - }); this.getDataModel = function () { CargarEmisor(); CargarAplicacion(); CargarUsuarios(); + $("#btnBuscarUsuario").unbind("click"); $("#btnBuscarUsuario").click(function () { BuscarUsuario(); @@ -21,38 +21,67 @@ this.getDataModel = function () { $("#btnAgregarUsuario").click(function () { AgregarUsuario(); }); - $('#btnGuardarPropuesta').click(function () { + + $("#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 () { + + SelectedCatalog = 'Aplicacion'; + + if ($.fn.DataTable.isDataTable('#tableAplicacion')) { + + LoadMessage(); + + $('#tableAplicacion').DataTable().search('').draw(); + + $('#modalAplicacion').modal('show'); + + ENDREQUEST(); + + } + }); + + $("#btnGuardar").unbind("click"); + $('#btnGuardar').click(function () { GuardarPropuesta(); }); - - $('#GridConvocados').TableInit(0, false, true, true, false, null, null); - - $(function () { - $("#txtFechaInicio").datepicker(); - }); - $(function () { - $("#txtFechaFinalizacion").datepicker(); - }); - $(function () { - $("#txtFechaMaximaConfirmarParticipacion").datepicker(); - }); + $('#tableParticipantes').TableInit(0, false, true, true, false, null, null); + $("#txtFechaInicio").datepicker(); + $("#txtFechaFinalizacion").datepicker(); + $("#txtFechaMaximaConfirmarParticipacion").datepicker(); } - this.CargarEmisor = function (filtro) { var uri = CatalogosWCF + '/api/ObtenerEmisorPopUp'; - var model= { + var model = { IdTipo: 1, - filtro: filtro == null ? '' : '&filtro=' + filtro + filtro: filtro == null ? '' : '&filtro=' + filtro } - AjaxPostData(uri, model, false, false, CargarGridEmisores, null, null); - + AjaxPostData(uri, model, false, false, CargarGridEmisores, null, null); + } -this.CargarGridEmisores = function (data) { +this.CargarGridEmisores = function (data) { if (data != null) { @@ -75,39 +104,6 @@ this.CargarGridEmisores = function (data) { } } -$('#tableEmisor').on('click', 'button', function () { - - var data = $('#tableEmisor').DataTable().row($(this).parents('tr')).data(); - - if (SelectedCatalog == "ObtenerEmisor") { - - $('#hiddenEmisor').val(data.codigo); - $('#txtEmisor').val(data.descripcion); - } - $('#modalEmisor').modal('hide'); - -}); - -$("#btnBuscarEmisor").click(function () { - - - SelectedCatalog = 'ObtenerEmisor'; - - if ($.fn.DataTable.isDataTable('#tableEmisor')) { - - LoadMessage(); - - $('#tableEmisor').DataTable().search('').draw(); - - $('#modalEmisor').modal('show'); - - ENDREQUEST(); - - } -}); - - - this.CargarAplicacion = function (filtro) { var uri = CatalogosWCF + '/api/ObtenerAplicacionPopUp'; @@ -143,48 +139,6 @@ this.CargarGridAplicacion = function (data) { } } -$('#tableAplicacion').on('click', 'button', function () { - - var data = $('#tableAplicacion').DataTable().row($(this).parents('tr')).data(); - - if (SelectedCatalog == "ObtenerAplicacion") { - - $('#hiddenAplicacion').val(data.codigo); - $('#txtAplicacion').val(data.descripcion); - } - $('#modalAplicacion').modal('hide'); - -}); - -$("#btnBuscarAplicacion").click(function () { - - - SelectedCatalog = 'ObtenerAplicacion'; - - if ($.fn.DataTable.isDataTable('#tableAplicacion')) { - - LoadMessage(); - - $('#tableAplicacion').DataTable().search('').draw(); - - $('#modalAplicacion').modal('show'); - - ENDREQUEST(); - - } -}); -this.AbrirConvocados = function () { - - $("#modalConvocados").modal('show'); - -} - -$('#tableParticipantes').on('click', 'button', function () { - - var tableParticipantes = $('#tableParticipantes').DataTable(); - tableParticipantes.row($(this).parents('tr')).remove().draw(); -}); - this.CargarUsuarios = function (filtro) { var uri = CatalogosWCF + '/api/ObtenerUsuario'; @@ -214,6 +168,12 @@ this.CargarGridUsuarios = function (data) { ENDREQUEST(); } +this.AbrirConvocados = function () { + + $("#modalConvocados").modal('show'); + +} + this.BuscarUsuario = function () { SelectedCatalog = 'Usuarios'; @@ -245,6 +205,45 @@ this.AgregarUsuario = function () { $('#hiddenUsuario').val(''); $('#txtUsuario').val(''); } + +this.LimpiarUsuario = function () { + $('#hiddenUsuario').val(''); + $('#txtUsuario').val(''); +} + +//TABLES +$('#tableAplicacion').on('click', 'button', function () { + + var data = $('#tableAplicacion').DataTable().row($(this).parents('tr')).data(); + + if (SelectedCatalog == "Aplicacion") { + + $('#hiddenAplicacion').val(data.codigo); + $('#txtAplicacion').val(data.descripcion); + } + $('#modalAplicacion').modal('hide'); + +}); + +$('#tableParticipantes').on('click', 'button', function () { + + var tableParticipantes = $('#tableParticipantes').DataTable(); + tableParticipantes.row($(this).parents('tr')).remove().draw(); +}); + +$('#tableEmisor').on('click', 'button', function () { + + var data = $('#tableEmisor').DataTable().row($(this).parents('tr')).data(); + + if (SelectedCatalog == "Emisor") { + + $('#hiddenEmisor').val(data.codigo); + $('#txtEmisor').val(data.descripcion); + } + $('#modalEmisor').modal('hide'); + +}); + $('#tableUsuarios').on('click', 'button', function () { var data = $('#tableUsuarios').DataTable().row($(this).parents('tr')).data(); @@ -257,10 +256,6 @@ $('#tableUsuarios').on('click', 'button', function () { $('#modalUsuario').modal('hide'); }); -this.LimpiarUsuario = function () { - $('#hiddenUsuario').val(''); - $('#txtUsuario').val(''); -} this.GuardarPropuesta = function () { @@ -272,25 +267,8 @@ this.GuardarPropuesta = function () { if (!confirm("Va a ingresar una nueva propuesta normativa .\n ¿Desea continuar?")) { return; } - - TableItems = $('#TableItems').DataTable(); - PropuestaNormativa - = { - NombreProyectoNormativo: $("#txtProyectoNormativo").val(), - IdTipoProyecto: 1, - IdEmisor: $('#hiddenEmisor').val(), - IdAplicacion: $('#hiddenAplicacion').val(), - - FechaInicioConsulta: $("#txtFechaInicio").val(), - FechaFinConsulta: $("#txtFechaFinalizacion").val(), - PromotorProyecto: $("#txtPromotorProyecto").val(), - IdEstado : 1, - FechaMaximaConfirmarParticipacion: $("#txtFechaMaximaConfirmarParticipacion").val() - } - model = { - ProyectoNormativo: PropuestaNormativa - } var uri = SinortWCF + '/api/GuardarProyectoNormativo'; + LeerFormulario(); AjaxPostData(uri, model, true, true, null, null, true); ENDREQUEST(); @@ -336,4 +314,28 @@ this.GuardarConvocadosPropuestaNormativa = function () { } +this.LeerFormulario = function () { + var PropuestaNormativa + = { + NombreProyectoNormativo: $("#txtProyectoNormativo").val(), + IdTipoProyecto: 1, + IdEmisor: $('#hiddenEmisor').val(), + IdAplicacion: $('#hiddenAplicacion').val(), + FechaInicioConsulta: $("#txtFechaInicio").val(), + FechaFinConsulta: $("#txtFechaFinalizacion").val(), + PromotorProyecto: $("#txtPromotorProyecto").val(), + IdEstado: 1 + } + + var momentFechaInicio = moment($("#txtFechaInicio").val(), "DD-MMMM-YYYY"); + PropuestaNormativa.FechaInicioConsulta = momentFechaInicio.format("MM-DD-YYYY"); + + var momentFechaFin = moment($("#txtFechaFinalizacion").val(), "DD-MMMM-YYYY"); + PropuestaNormativa.FechaFinConsulta = momentFechaFin.format("MM-DD-YYYY"); + + var momentFechaMaxima = moment($("#txtFechaMaximaConfirmarParticipacion").val(), "DD-MMMM-YYYY"); + PropuestaNormativa.FechaMaximaConfirmarParticipacion = momentFechaMaxima.format("MM-DD-YYYY"); + + model.ProyectoNormativo = PropuestaNormativa; +} diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js index 4c6c0154d..759d03123 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/ProyectoNormativo.js @@ -9,17 +9,15 @@ jQuery(document).ready(function () { this.CargarSitios = function () { var uri = CatalogosWCF + '/api/ObtenerSitios'; - AjaxPostData(uri, Item, true, false, CargarTablaSitios, null, null); + AjaxPostData(uri, Item, true, true, CargarTablaSitios, null, null); } this.CargarTablaSitios = function (data) { - if (data != null) { - lista = data; + if (data != null && data.ProyectosNormativos != null) { + ProyectosNormativos = data.ProyectosNormativos; var Seleccionar = $("#ucbtnVista").html(); - - var columnDefinition = [ { "data": "IdProyectoNormativo","visible":false }, { "data": "NombreProyectoNormativo" }, @@ -27,7 +25,7 @@ this.CargarTablaSitios = function (data) { { "data": null, className: "center", defaultContent: Seleccionar } ]; - $('#tableSitios').TableInit(1, true, true, true, true, columnDefinition, lista); + $('#tableSitios').TableInit(1, true, true, true, true, columnDefinition, ProyectosNormativos); if ($.fn.DataTable.isDataTable('#tableSitios')) { diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml index c0f4cd3e8..e5128360b 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml @@ -27,7 +27,7 @@ @*---------------------Nombre Proyecto ---------------------------------------------------------*@
-
+
@@ -35,7 +35,7 @@ @*---------------------Promotor Proyecto---------------------------------------------------------*@
-
+
@@ -43,7 +43,7 @@ @*---------------------Estado Proyecto---------------------------------------------------------*@
-
+
@@ -54,7 +54,7 @@
-
+
@@ -64,12 +64,24 @@
-
+
+ + @*---------------------Fecha de finalización de consulta---------------------------------------------*@ +
+ + +
+ + +
+ +
+
@@ -86,7 +98,6 @@ Participante Nombre - Fecha Máxima Confirmación Fecha Creación diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml index 10da0bfc9..2d311aab5 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/Index.cshtml @@ -1,8 +1,4 @@ -@*@section ButtonOption { - - }*@ - -@{ +@{ ViewBag.Title = "Propuesta Normativa"; Layout = "~/Views/Shared/_Layout.cshtml"; @@ -14,28 +10,30 @@
- @*
*@ - -
- @*---------------------Proyecto normativo---------------------------------------------------------*@ - -
- -
- + @*---------------------Nombre Proyecto ---------------------------------------------------------*@ +
+ +
+
- + @*---------------------Promotor Proyecto---------------------------------------------------------*@ +
+ +
+ +
+
@*---------------------Emisor---------------------------------------------------------*@
- +
@@ -44,46 +42,44 @@ -
- @*---------------------Aplicación---------------------------------------------------------*@
- +
- + -
- - @*---------------------Convocados---------------------------------------------------------*@
- -
+ +
+
@@ -91,58 +87,46 @@ @*---------------------Fecha de inicio de consulta---------------------------------------------*@
- + -
+
-
@*---------------------Fecha de finalización de consulta---------------------------------------------*@
- + -
+
- -
- +
- @*---------------------Promotor del proyecto---------------------------------------------------------*@ - -
- -
-
-
- @*---------------------Fecha máxima para confirmar participación date---------------------------------------------*@
- + -
+
- +
-
diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/ProyectoNormativoDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/ProyectoNormativoDAL.cs index a39b30930..6fc1781a0 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/ProyectoNormativoDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/ProyectoNormativoDAL.cs @@ -42,43 +42,41 @@ namespace AYA.SlnSinortModel.DAL.Sinort Conn.SaveChanges(); Conn.Commit(); model.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO; - model.IdProyectoNormativo = model.ProyectoNormativo.IdProyectoNormativo; } } catch (DbEntityValidationException ex) { - //log.Error(ex); + log.Error(ex); model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; } catch (Exception ex) { - //log.Error(ex); + log.Error(ex); model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; } return model; } - public List ObtenerSitios() + public ProyectoNormativoJSON ObtenerSitios() { - List registros = null; - + ProyectoNormativoJSON model = new ProyectoNormativoJSON(); try { using (SinortContex db = new SinortContex()) { - registros = db.ProyectoNormativo.Include(p=> p.TipoProyecto).AsNoTracking().ToList(); - - + model.ProyectosNormativos = db.ProyectoNormativo.Include(p=> p.TipoProyecto).AsNoTracking().ToList(); + model.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO; } } catch (Exception ex) { - //log.Error(ex); + model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; + log.Error(ex); } - return registros; + return model; } } } diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/UsuarioDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/UsuarioDAL.cs index c8d5345c9..f24c70a40 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/UsuarioDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/UsuarioDAL.cs @@ -23,7 +23,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort { using (SinortContex db = new SinortContex()) { - registros = db.Usuario.Where(t => t.Estado == true).OrderBy(q => q.NombreUsuario).ToList(); + registros = db.Usuario.Where(t => t.Estado == true).OrderByDescending(q => q.NombreUsuario).ToList(); } } diff --git a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs index ebe1b6c00..93d097894 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs @@ -17,6 +17,6 @@ namespace AYA.SlnSinortModel.Entidades { public ProyectoNormativo ProyectoNormativo { get; set; } public Convocatoria Convocado { get; set; } - public int? IdProyectoNormativo { get; set; } + public List ProyectosNormativos { get; set; } } } diff --git a/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs b/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs index 2e1514e20..9a3a498fa 100644 --- a/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs +++ b/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs @@ -59,6 +59,8 @@ namespace Atesa.Utilitarios var sr = new StreamReader(ms); var serializer = new Newtonsoft.Json.JsonSerializer(); serializer.Converters.Add(new StringEnumConverter { AllowIntegerValues = false, CamelCaseText = false }); + serializer.Converters.Add(new IsoDateTimeConverter() { DateTimeFormat = "dd-MM-YYYY HH:mm:ss" }); + if (parameters.Length == 1) { // single parameter, assuming bare @@ -112,6 +114,7 @@ namespace Atesa.Utilitarios serializer.PreserveReferencesHandling = PreserveReferencesHandling.Objects; serializer.Converters.Add(new StringEnumConverter { AllowIntegerValues = false, CamelCaseText = false }); + serializer.Converters.Add(new IsoDateTimeConverter() { DateTimeFormat = "dd-MM-YYYY HH:mm:ss" }); Message replyMessage = null; try {