private void btnAcceder_Click(object sender, EventArgs e) { frmAddEmpleado fr = new frmAddEmpleado(); fr.btnEditar.Visible = false; fr.btnGuardar.Visible = true; fr.Show(); }
private void button2_Click(object sender, EventArgs e) { frmAddEmpleado fr = new frmAddEmpleado(); if (dtgvEmpleados.SelectedRows.Count > 0) { fr.btnEditar.Visible = true; fr.btnGuardar.Visible = false; fr.txtId.Text = dtgvEmpleados.CurrentRow.Cells["Id"].Value.ToString(); fr.txtNombre.Text = dtgvEmpleados.CurrentRow.Cells["Nombre"].Value.ToString(); fr.txtTelefono.Text = dtgvEmpleados.CurrentRow.Cells["Telefono"].Value.ToString(); fr.txtUsuario.Text = dtgvEmpleados.CurrentRow.Cells["Usuario"].Value.ToString(); fr.txtContraseña.Text = dtgvEmpleados.CurrentRow.Cells["Contraseña"].Value.ToString(); fr.Show(); } else { MessageBox.Show("Seleccione un empleado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }