From ea98aaac6f80bbdd61abba2d96d12041bdda986b Mon Sep 17 00:00:00 2001 From: mumana Date: Thu, 21 Jun 2018 18:24:33 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C90 --- .../AYA.SlnSynor/Sinort-Scripts/Global.js | 13 +++++++++ .../PropuestaNormativa/PropuestaNormativa.js | 28 ++++++++----------- .../NewtonsoftJsonDispatchFormatter.cs | 4 +-- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js index 3af63ea1f..b2ae8fcef 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js @@ -1074,6 +1074,19 @@ $.fn.dotNetFormat = function () { return ''; }; +$.fn.DateFormatWCF = function () { + + if (this.val() != null && this.val() != '') { + + var momentDate = moment(this.val(), "DD-MMMM-YYYY"); + var dotNetFormatDate = momentDate.format("YYYY-MM-DD"); + + return dotNetFormatDate; + } + else + return ''; +}; + $.fn.CalculateLaboralAge = function (controlYear, controlMonth, controlEndDate) { if ($.trim(this.val()) == "") { diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js index d58d3c313..b00785581 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/PropuestaNormativa.js @@ -39,7 +39,7 @@ this.getDataModel = function () { } }); - + $("#btnBuscarAplicacion").unbind("click"); $("#btnBuscarAplicacion").click(function () { @@ -74,14 +74,14 @@ this.CargarEmisor = function (filtro) { var uri = CatalogosWCF + '/api/ObtenerEmisorPopUp'; 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) { @@ -102,7 +102,7 @@ this.CargarGridEmisores = function (data) { toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error); } - } +} this.CargarAplicacion = function (filtro) { @@ -315,20 +315,14 @@ this.LeerFormulario = function () { 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"); + PropuestaNormativa.FechaInicioConsulta = $("#txtFechaInicio").DateFormatWCF(); + PropuestaNormativa.FechaFinConsulta = $("#txtFechaFinalizacion").DateFormatWCF(); + PropuestaNormativa.FechaMaximaConfirmarParticipacion = $("#txtFechaMaximaConfirmarParticipacion").DateFormatWCF(); + model.ProyectoNormativo = PropuestaNormativa; } diff --git a/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs b/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs index 9a3a498fa..d12a03349 100644 --- a/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs +++ b/AYA.SlnSynor/Atesa.Utilitarios/NewtonsoftJsonDispatchFormatter.cs @@ -59,7 +59,7 @@ 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" }); + //serializer.Converters.Add(new IsoDateTimeConverter() { DateTimeFormat = "dd-MM-YYYY HH:mm:ss" }); if (parameters.Length == 1) { @@ -114,7 +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" }); + //serializer.Converters.Add(new IsoDateTimeConverter() { DateTimeFormat = "dd-MM-YYYY HH:mm:ss" }); Message replyMessage = null; try {