public ActionResult <MovLoteViewModel> GetPrimeiroMovimentoLote([FromHeader] string ibge, int?id_produto, int?id_unidade, string lote) { try { ibge = _config.GetConnectionString(Connection.GetConnection(ibge)); MovLoteViewModel data = _repository.GetPrimeiroMovimentoLote(ibge, id_produto, id_unidade, lote); return(Ok(data)); } catch (Exception ex) { var response = TrataErro.GetResponse(ex.Message, true); return(StatusCode((int)HttpStatusCode.InternalServerError, response)); } }
public MovLoteViewModel GetPrimeiroMovimentoLote(string ibge, int?id_produto, int?id_unidade, string lote) { try { var datalote = Helpers.HelperConnection.ExecuteCommand(ibge, conn => conn.QueryFirstOrDefault <DateTime?>(_command.GetPrimeiroMovimentoLote, new { @id_produto = id_produto, @id_unidade = id_unidade, @lote = lote })); var movlote = new MovLoteViewModel() { data = datalote }; return(movlote); } catch (Exception ex) { throw ex; } }