private void btnAñadir_Click(object sender, EventArgs e) { var form = new FormCatalogoClienteEmergente(); form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { btnRefrescar.PerformClick(); } }
private void btnEditar_Click(object sender, EventArgs e) { if (dgClientes.SelectedRows.Count == 1) { int id = int.Parse(dgClientes.CurrentRow.Cells["ID"].Value.ToString()); string pNombre = dgClientes.CurrentRow.Cells["Primer Nombre"].Value.ToString(); string sNombre = dgClientes.CurrentRow.Cells["Segundo Nombre"].Value.ToString(); string pApellido = dgClientes.CurrentRow.Cells["Primer Apellido"].Value.ToString(); string sApellido = dgClientes.CurrentRow.Cells["Segundo Apellido"].Value.ToString(); string correo = dgClientes.CurrentRow.Cells["Correo"].Value.ToString(); string celular = dgClientes.CurrentRow.Cells["Celular"].Value.ToString(); var form = new FormCatalogoClienteEmergente(id, pNombre, sNombre, pApellido, sApellido, correo, celular); form.ShowDialog(); if (form.DialogResult == DialogResult.OK) { btnRefrescar.PerformClick(); } } else { MessageBox.Show("Seleccione una fila antes de modificar.", "Productos Para Mascotas", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }