public IHttpActionResult GenerarReporteInfoGlobal([FromUri] InfoGlobalQuery query) { StringBuilder builder = new StringBuilder(); long tickDesde = (query.FechaDesde != null ? query.FechaDesde.Value : DateTimeHelper.GetMinDateTimeNullable(query.FechaDesde)).Ticks; builder.Append(tickDesde); builder.Append(","); long tickHasta = (query.FechaHasta == null && query.FechaDesde != null ? DateTime.Today : DateTimeHelper.GetMinDateTimeNullable(query.FechaHasta)).Ticks; builder.Append(tickHasta); builder.Append(","); builder.Append(query.PersonaJuridicaId != null ? query.PersonaJuridicaId.Value : -1); builder.Append(","); builder.Append(query.SalaCunaId != null ? query.SalaCunaId.Value : -1); builder.Append(","); builder.Append(query.Codigo); builder.Append(","); builder.Append(query.DepartamentoId != null ? query.DepartamentoId.Value : -1); builder.Append(","); builder.Append(query.LocalidadId != null ? query.LocalidadId.Value : -1); builder.Append(","); builder.Append(query.BarrioId != null ? query.BarrioId.Value : -1); builder.Append(","); builder.Append(query.SituacionCritica); builder.Append(","); builder.Append(query.Ubicacion); ActualizarReporteCommand command = new ActualizarReporteCommand(); command.IdEstado = (int)EstadoReporteEnum.Pendiente; command.StringProceso = builder.ToString(); command.IdUsuario = GetUsuarioLogueado().Id; command.NombreProceso = TiposReporte.InfoGlobal.Value; _commandDispatcher.Dispatch <ActualizarReporteCommand>(command); var respuesta = new { mensaje = _mensaje + GetEmailUsuarioLogueado() }; return(Ok(respuesta)); }
public IHttpActionResult GetReporteInfoGlobal([FromUri] InfoGlobalQuery query) { InfoGlobalQueryResults queryResult = _queryDispatcher.Dispatch <InfoGlobalQuery, InfoGlobalQueryResults>(query); return(Ok(queryResult)); }