public CommandResponse AdicionarExecucao(AgendamentoExecucao obj) { try { using (_contexto.Connection) { _contexto.GetConnection(); var param = new DynamicParameters(); param.Add(name: "IdExecucao", value: obj.IdExecucao, direction: System.Data.ParameterDirection.Input); param.Add(name: "IdProcesso", value: obj.IdProcesso, direction: System.Data.ParameterDirection.Input); param.Add(name: "MensagemStatus", value: obj.MensagemStatus, direction: System.Data.ParameterDirection.Input); param.Add(name: "Inicio", value: obj.Inicio, direction: System.Data.ParameterDirection.Input); param.Add(name: "Fim", value: obj.Fim, direction: System.Data.ParameterDirection.Input); param.Add(name: "Status", value: obj.Status, direction: System.Data.ParameterDirection.Input); _contexto.Connection.Execute(AgentamentoExecucoesQueries.InsertExecucao(), param); return(new CommandResponse(true, $"Execucao adicionada com sucesso")); } } catch (SQLiteException ex) { return(new CommandResponse(false, $"Erro : {ex.Message}")); } }
public IEnumerable <AgendamentoExecucao> ObterTodasExecucoes(int?quantidade = null) { try { using (_contexto.Connection) { _contexto.GetConnection(); var execucao = _contexto .Connection .Query <AgendamentoExecucao>(AgentamentoExecucoesQueries.ObterTodasExecucoes(), new { }); return(execucao); } } catch (SQLiteException ex) { throw ex; } }
public AgendamentoExecucao ObterExecucao(string Id) { try { using (_contexto.Connection) { _contexto.GetConnection(); var execucao = _contexto .Connection .Query <AgendamentoExecucao>(AgentamentoExecucoesQueries.ObterExecucaoPorId(Id), new { Id = Id }).FirstOrDefault(); return(execucao); } } catch (SQLiteException ex) { throw ex; } }