Ejemplo n.º 1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            try
            {
                dto.Id        = Convert.ToInt32(DgvListDespesa.CurrentRow.Cells[0].Value);
                dto.Descricao = DgvListDespesa.CurrentRow.Cells[1].Value.ToString();
                dto.Valor     = DgvListDespesa.CurrentRow.Cells[2].Value.ToString();
                //cbo Despesa
                dto.CategoriaDespesa = (int)DgvListDespesa.CurrentRow.Cells[3].Value;
                dto.DescCategoria    = DgvListDespesa.CurrentRow.Cells[4].Value.ToString();
                //cbo Conta
                dto.Conta          = (int)DgvListDespesa.CurrentRow.Cells[5].Value;
                dto.DescConta      = DgvListDespesa.CurrentRow.Cells[6].Value.ToString();
                dto.DataVencimanto = Convert.ToDateTime(DgvListDespesa.CurrentRow.Cells[7].Value);
                dto.Observacao     = DgvListDespesa.CurrentRow.Cells[8].Value.ToString();

                FrmCadDespesa alterarDespesa = new FrmCadDespesa(dto);
                alterarDespesa.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Nenhum lançamento foi selecionado. \nSelecione um lançamento para que possa ser feita a alteração:", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            CarregarGrid();
        }
Ejemplo n.º 2
0
        private void BtnCadDespesa_Click(object sender, EventArgs e)
        {
            FrmCadDespesa despesa = new FrmCadDespesa();

            despesa.ShowDialog();
            CarregarGrid();
        }