private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (dtpFechaInicio.Value.Date <= dtpFechaFin.Value.Date)
            {
                try
                {
                    short AnoEgreso = txtAnoEgresoBus.Text.Trim().ToString() == string.Empty ? short.Parse("0") : Convert.ToInt16(txtAnoEgresoBus.Text.Trim().ToString());

                    DataTable nuevo = EgresadoBR.GetEgresadoTabla(AnoEgreso, txtEgresadoBus.Text.Trim().ToString(), txtDNIBus.Text.Trim().ToString(), dtpFechaInicio.Value, dtpFechaFin.Value);

                    if (nuevo.Rows.Count > 0)
                    {
                        dgvEgresados.DataSource = nuevo;
                    }
                    else
                    {
                        MessageBox.Show("No se encontraron Datos.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("No se pudo cargar los datos correctamente." + Environment.NewLine + ex.ToString(), "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("No ha colocado correctamente las Fechas de Inicio y Fecha de Fin.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        private void CargarEgresado(int IdEgresado)
        {
            try
            {
                LimpiarEgresado();
                LimpiarEgresadoDetalle();

                oEgresado = new EgresadoBE();
                oEgresado = EgresadoBR.GetEgresado(IdEgresado);

                txtNombres.Text         = oEgresado.Nombres;
                txtApellidoPaterno.Text = oEgresado.ApellidoPaterno;
                txtApellidoMaterno.Text = oEgresado.ApellidoMaterno;
                txtDNI.Text             = oEgresado.DNI;
                dtpFechaNac.Value       = oEgresado.FechaNacimiento;
                txtDireccion.Text       = oEgresado.Direccion;
                txtDistrito.Text        = oEgresado.Distrito;
                txtProvincia.Text       = oEgresado.Provincia;
                txtTelefono.Text        = oEgresado.Telefono;
                txtCelular.Text         = oEgresado.Celular;
                txtEmail.Text           = oEgresado.Email;
                txtAnoEgreso.Text       = oEgresado.AñoEgreso.ToString();

                bsrEgresadosDetalle.DataSource = oEgresado.Detalle;
                bsrEgresadosDetalle.ResetBindings(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se pudo cargar los datos correctamente." + Environment.NewLine + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Guardar()
        {
            try
            {
                if (ValidarEstado() < 2 || true)
                {
                    if (CamposValidosEgresado() == string.Empty)
                    {
                        if (MessageBox.Show("¿Desea Guardar el Registro?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            LlenarEgresado();
                            switch (EstadoFormulario)
                            {
                            case EstadoForm.Insertando:
                                EgresadoBR.InsEgresado(oEgresado);
                                break;

                            case EstadoForm.Modificando:
                                EgresadoBR.UpdEgresado(oEgresado, Convert.ToInt32(EstadoOperacion.Activo));
                                break;
                            }
                            MessageBox.Show("Se guardó Satisfactoriamente.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            EstadoFormulario = EstadoForm.Navegando;
                            CargarEgresado(oEgresado.IdEgresado);
                        }
                    }
                    else
                    {
                        MessageBox.Show(CamposValidosEgresado(), "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("Solo puede tener un Trabajo Activo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se pudo realizar la operación." + Environment.NewLine + ex.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Eliminar()
        {
            try
            {
                if (MessageBox.Show("¿Esta seguro de Eliminar el Registro?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    EgresadoBR.UpdEgresado(oEgresado, Convert.ToInt32(EstadoOperacion.Inactivo));

                    MessageBox.Show("Se Eliminó Satisfactoriamente.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                    LimpiarEgresado();
                    LimpiarEgresadoDetalle();
                    oEgresado        = null;
                    EstadoFormulario = EstadoForm.Vacio;
                    bsrEgresadosDetalle.Clear();
                    bsrEgresadosDetalle.ResetBindings(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se pudo realizar la operación." + Environment.NewLine + ex.ToString(), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }