public bool AlterarConta(Conta cont) { try { DALCaixa DALObj = new DALCaixa(); DALObj.Alterar(cont); return(true); } catch (Exception) { return(false); } }
public bool Excluir(Conta item) { //escreve a função de excluir, krl DALCaixa objDAL = new DALCaixa(); if (objDAL != null) { objDAL.Excluir(item); return(true); } else { return(false); } }
private void frmCaixa_Load(object sender, EventArgs e) { DALCaixa objDAL = new DALCaixa(); FluxoCaixa caixa = new FluxoCaixa(); tabControl1.TabPages.Remove(tabPage2);//se tornou inutil, o controle já é feito por contador e repassado mensalmente if ((caixa = objDAL.verificarAberturaCaixa()) != null) { //tabControl1.TabPages.Add(tabPage3); tabControl1.TabPages.Remove(tabPage3); } else { tabControl1.TabPages.Remove(tabPage4); } }
public Conta retornarDivida(int id) { Conta divida = new Conta(); try { DALCaixa DALObj = new DALCaixa(); if ((divida = DALObj.selecionarConta(id)) != null) { return(divida); } else { return(null); } } catch (Exception) { return(null); } }
public List <DividaModel> listarDividas() { List <DividaModel> div = new List <DividaModel>(); try { DALCaixa DALObj = new DALCaixa(); if ((div = DALObj.listarDividas()) != null) { return(div); } else { return(null); } } catch (Exception) { return(null); } }
public bool Salvar(Conta item) { try { DALCaixa DALobj = new DALCaixa(); if (DALobj.Salvar(item) == true) { DALobj = null; return(true); } else { DALobj = null; return(false); } } catch (Exception) { return(false); } }
private void btnAbrir_Click(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(txtValorAbertura.Text, "^[0-9]{1,4}([,.][0-9]{1,2})?$")) { DALCaixa objDAL = new DALCaixa(); FluxoCaixa caixa = new FluxoCaixa(); caixa.ValorAbertura = decimal.Parse(txtValorAbertura.Text); caixa.DataAbertura = DateTime.Now; objDAL.AbrirCaixa(caixa); tabControl1.TabPages.Remove(tabPage3); if (!tabPage4.IsAccessible) { tabControl1.TabPages.Add(tabPage4); } limparTextBoxes(this.Controls); } else { MessageBox.Show("Informe algum valor !"); } }
public decimal?calcularContasAPagar() { Decimal? valor = 0; List <decimal?> valores = new List <Decimal?>(); try { DALCaixa DALObj = new DALCaixa(); if ((valor = DALObj.calcularContasAPagar()) != null) { return(valor); } else { return(valor); } } catch (Exception) { return(valor); } }
private void btnFecharCaixa_Click(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(txtValorFechamento.Text, "^[0-9]{1,4}([,.][0-9]{1,2})?$")) { DALCaixa objDAL = new DALCaixa(); FluxoCaixa caixa = new FluxoCaixa(); caixa.DataFechamento = DateTime.Now; if ((caixa = objDAL.verificarFechamento(caixa)) == null) { MessageBox.Show("O fechamento não foi feito no dia certo,terá que ser aberto um novo caixa !"); //caixa.Fluxo = null; //objDAL.FecharCaixa(caixa); } else { if (caixa.ValorFechamento == null) { caixa.ValorFechamento = decimal.Parse(txtValorFechamento.Text); objDAL.FecharCaixa(caixa); } else { MessageBox.Show("Fechamento de caixa do dia já efetuado !"); } } tabControl1.TabPages.Remove(tabPage4); //tabControl1.TabPages.Add(tabPage3); limparTextBoxes(this.Controls); } else { MessageBox.Show("Informe algum valor !"); } }
public ModeloCaixa CarregaModeloCaixa(int codigo) { DALCaixa DALobj = new DALCaixa(conexao); return(DALobj.CarregaModeloCaixa(codigo)); }
public DataTable LocalizarCaixasF(String valor, string dtinicial) { DALCaixa DALobj = new DALCaixa(conexao); return(DALobj.LocalizarCaixaF(valor, dtinicial)); }
public DataTable Localizar(String valor) { DALCaixa DALobj = new DALCaixa(conexao); return(DALobj.Localizar(valor)); }
public void Incluir(ModeloCaixa modelo) { DALCaixa DALobj = new DALCaixa(conexao); DALobj.Incluir(modelo); }
private void btnRecalcular_Click(object sender, EventArgs e) { DALCaixa objDAL = new DALCaixa(); txtCaixa.Text = (objDAL.somarBalanco(DateTime.Parse(dtpInicio.Text), DateTime.Parse(dtpFim.Text))).ToString(); }