private void BtnAdicionar_Click(object sender, EventArgs e) { frmIncluirAlterarContato form = new frmIncluirAlterarContato(); form.ShowDialog(); CarregarDataGridView(); }
private void BtnAlterar_Click(object sender, EventArgs e) { Contato contato = new Contato { Id = (int)dgvAgenda.CurrentRow.Cells[0].Value, Nome = dgvAgenda.CurrentRow.Cells[1].Value.ToString(), Email = dgvAgenda.CurrentRow.Cells[2].Value.ToString(), Telefone = (int)dgvAgenda.CurrentRow.Cells[3].Value }; frmIncluirAlterarContato form = new frmIncluirAlterarContato(contato); form.ShowDialog(); CarregarDataGridView(); }