private void btnBuscar_Click(object sender, EventArgs e) { EmpleadoBusiness empleadoBusiness = new EmpleadoBusiness(); try { dgvBusqueda.DataSource = empleadoBusiness.listar(cboFiltro.SelectedIndex, txtBuscar.Text); dgvBusqueda.Columns[0].Visible = false; dgvBusqueda.Columns[4].Visible = false; dgvBusqueda.Columns[5].Visible = false; dgvBusqueda.Columns[8].Visible = false; dgvBusqueda.ClearSelection(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { } }
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; }
public IEnumerable <Empleado> Get() { empleadoBusiness = new EmpleadoBusiness(configuration.GetConnectionString("VideoContext").ToString()); return(empleadoBusiness.GetAll()); }