Example #1
0
        public IHttpActionResult GetEncomendasOrdenadasPorDataECliente(string filial, string serie, bool descDate, bool descCliente)
        {
            List <EncomendaCliente> encomendas = null;

            try {
                encomendas = PriIntegration.GetEncomendasClientesPorOrdenacao(filial, serie, true, descDate, true, descCliente);
            } catch (InvalidOperationException e) {
                return(BadRequest(e.Message));
            } catch (Exception e) {
                return(InternalServerError(e));
            }

            if (encomendas == null || encomendas.Count < 1)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }
            else
            {
                return(Ok(encomendas));
            }
        }