예제 #1
0
        public IHttpActionResult GetEncomendaByClienteAndNumber(string id, string filial, string serie, int n)
        {
            List <EncomendaCliente> encomendas = null;

            try {
                encomendas = PriIntegration.GetEncomendasClientes(filial, serie, id, n);
            } 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));
            }
        }