public IHttpActionResult ConsultarReservaPorFechas([FromBody] ReservaFiltro filtro)
        {
            try
            {
                var json = filtro.SerializeObject();
                Logger.Info($"Filtro {json}");
                var response = _services.ConsultarReservas(filtro);

                return(Ok(response));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        public List <Reservas> ConsultarReservas(ReservaFiltro filtro)
        {
            try
            {
                var query = DataBase.Query <Reservas, TipoIdentificacion, Reservas>(sql: "CompanyDB_SP_ReservasConsultar",
                                                                                    param: new
                {
                    filtro.ReservaId,
                    filtro.FechaCreacionIni,
                    filtro.FechaCreacionFin
                }, map: (r, ti) => { r.TipoIdentificacion = ti; return(r); }, splitOn: "split", commandType: CommandType.StoredProcedure).ToList();

                return(query ?? new List <Reservas>());
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
        public ResponseModel ConsultarReservas(ReservaFiltro filtro)
        {
            ResponseModel response = new ResponseModel();

            try
            {
                filtro.ReservaId = null;
                var reservas = _data.ConsultarReservas(filtro);

                response.SuccesCall(reservas);
            }
            catch (BusinessException ex)
            {
                response.Fail(ex);
            }
            catch (Exception ex)
            {
                response.Fail(ex, $"Error en => {nameof(ConsultarReservas)}");
                Logger.ErrorFatal($"ReservasServices {nameof(ConsultarReservas)}", ex);
            }
            return(response);
        }