Ejemplo n.º 1
0
 public ActionResult <ProcedimentoAvulso> InserirItem([FromHeader] string ibge, [FromBody] ProcedimentoAvulsoItem model)
 {
     try
     {
         ibge = _config.GetConnectionString(Connection.GetConnection(ibge));
         model.id_sequencial = _repository.GetNewIdItem(ibge);
         model.uuid          = _repository.GetNewUuid(ibge);
         _repository.InserirItem(ibge, model);
         return(Ok(model));
     }
     catch (Exception ex)
     {
         var response = TrataErro.GetResponse(ex.Message, true);
         return(StatusCode((int)HttpStatusCode.InternalServerError, response));
     }
 }