public string CarregarPagamentosOntem(DaoKPIFinanceiroPagamentosOntemColecao daoKPIFinanceiroPagamentosOntemColecao) { try { string retorno = "ok"; dalMySql.LimparParametros(); dalMySql.ExecutarManipulacao(CommandType.StoredProcedure, "uspKPIFinanceiroPagamentosOntemDeletar"); DataTable dataTableDaoKPIFinanceiroPagamentosOntemColecao = ConvertToDataTable(daoKPIFinanceiroPagamentosOntemColecao); foreach (DataRow linha in dataTableDaoKPIFinanceiroPagamentosOntemColecao.Rows) { DaoKPIFinanceiroPagamentosOntem daoKPIFinanceiroPagamentosOntem = new DaoKPIFinanceiroPagamentosOntem(); daoKPIFinanceiroPagamentosOntem.Qtd = Convert.ToInt32(linha["Qtd"]); daoKPIFinanceiroPagamentosOntem.Valor = Convert.ToDecimal(linha["Valor"]); dalMySql.LimparParametros(); dalMySql.AdicionaParametros("@Qtd", daoKPIFinanceiroPagamentosOntem.Qtd); dalMySql.AdicionaParametros("@Valor", daoKPIFinanceiroPagamentosOntem.Valor); dalMySql.ExecutarManipulacao(CommandType.StoredProcedure, "uspKPIFinanceiroPagamentosOntemInserir"); } return(retorno); } catch (Exception ex) { throw new Exception("Nao foi Possivel inserir dados no KPI Financeiro - Pagamentos Ontem . Detalhes: " + ex.Message); } }
public DaoKPIFinanceiroPagamentosOntemColecao RetornaPagamentosOntem() { try { DaoKPIFinanceiroPagamentosOntemColecao daoKPIFinanceiroPagamentosOntemColecao = new DaoKPIFinanceiroPagamentosOntemColecao(); dalSqlServer.LimparParametros(); DataTable dataTableDaoKPIFinanceiroPagamentosOntemColecao = dalSqlServer.ExecutarConsulta(CommandType.StoredProcedure, "uspKPIFinanceiroPagamentosOntem"); foreach (DataRow linha in dataTableDaoKPIFinanceiroPagamentosOntemColecao.Rows) { DaoKPIFinanceiroPagamentosOntem daoKPIFinanceiroPagamentosOntem = new DaoKPIFinanceiroPagamentosOntem(); daoKPIFinanceiroPagamentosOntem.Qtd = Convert.ToInt32(linha["Qtd"]); daoKPIFinanceiroPagamentosOntem.Valor = Convert.ToDecimal(linha["Valor"]); daoKPIFinanceiroPagamentosOntemColecao.Add(daoKPIFinanceiroPagamentosOntem); } return(daoKPIFinanceiroPagamentosOntemColecao); } catch (Exception ex) { throw new Exception("Nao foi Possivel consultar os Pagamentos de Ontem. Detalhes: " + ex.Message); } }