private void btnCancelar_Click(object sender, EventArgs e) { deshabilitar(); btnSiguiente.Visible = true; btnAnterior.Visible = true; btnAnterior.Enabled = false; btnUltimo.Visible = true; if (empleadoBusiness.obtenerIDMax() == 0) { btnUltimo.Enabled = false; btnSiguiente.Enabled = false; } else { btnUltimo.Enabled = true; btnSiguiente.Enabled = true; } btnPrimero.Visible = true; btnPrimero.Enabled = false; btnSalir.Location = new Point(107, 398); btnCancelar.Visible = false; lblNroId.Text = "0"; buscarToolStripMenuItem.Visible = true; }
public void rdoBusqueda() { EmpleadoBusiness empleadoBusiness = new EmpleadoBusiness(); habilitar(); lblNroId.Text = empleado.IdPersona.ToString(); txtNombre.Text = empleado.Nombre; txtApellido.Text = empleado.Apellido; txtDni.Text = empleado.Dni; dtpFechaNac.Value = empleado.FechaNac; txtNumero.Text = empleado.Telefono.Numero; cbxActivo.Checked = empleado.Estado; cboTipoTelefono.SelectedIndex = empleado.Telefono.TipoTelefono.IdTipoTelefono - 1; cboTipoTelefono.Text = empleado.Telefono.TipoTelefono.NombreTipoTelefono; txtMail.Text = empleado.Mail; txtContacto.Text = empleado.Telefono.Contacto; btnSalir.Location = new System.Drawing.Point(164, 398); RolBusinness rolBusinness = new RolBusinness(); cboRol.SelectedIndex = rolBusinness.obtenerRol(empleado.IdPersona) - 2; if (String.Compare(empleado.Sexo, "M") >= 0) { rbtnHombre.Checked = true; } else { rbtnMujer.Checked = true; } lblNroId.Visible = true; lblId.Visible = true; btnSiguiente.Visible = true; btnAnterior.Visible = true; txtNombre.Focus(); btnCancelar.Visible = false; btnGuardar.Text = "Modificar"; if (empleado.IdPersona < empleadoBusiness.obtenerIDMax()) { btnSiguiente.Enabled = true; btnUltimo.Enabled = true; } else { btnSiguiente.Enabled = false; btnUltimo.Enabled = false; } if (empleadoBusiness.obtenerIDMin() < empleado.IdPersona) { btnAnterior.Enabled = true; btnPrimero.Enabled = true; } else { btnAnterior.Enabled = false; btnPrimero.Enabled = false; } eliminarToolStripMenuItem.Visible = true; }