Beispiel #1
0
        public IHttpActionResult PostEncomendas(PedidoTransformacaoECL encomenda)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try {
                if (PriIntegration.GerarGuiaRemessa(encomenda))
                {
                    return(Ok());
                }
                else
                {
                    return(BadRequest());
                }
            } catch (InvalidOperationException e) {
                return(BadRequest(e.Message));
            } catch (Exception e) {
                return(InternalServerError(e));
            }
        }