private void MenuPerfilesEmpleados_Click(object sender, RoutedEventArgs e)
 {
     BusquedaEmpleados _busEmple = new BusquedaEmpleados();
     _busEmple.InitializeComponent();
     this.Close();
     _busEmple.Show();
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            sendEmail enviarCorreo = new sendEmail();
            string error = "";

            if (opcion == 1)
            {

                bool result = enviarCorreo.EnviarDatosCorreo(txt_destinatario.Text, txt_subject.Text, txt_message.Text,txt_cc.Text, ventanaCurriculum.ReportViewerCurriculumEmp, ref error);

                if (!result)
                {
                    MessageBox.Show("Ocurrio un error al adjuntar y enviar el correo" + error);
                }
                else
                {
                    MessageBoxResult MsCorreo = MessageBox.Show("EL CURRICULUM DEL EMPLEADO FUE ENVIADO CON EXITO..", "MENSAJE DE CONFIRMACION", MessageBoxButton.OK, MessageBoxImage.Information);
                    if (MsCorreo == MessageBoxResult.OK)
                    {
                        BusquedaEmpleados _menusBusqueda = new BusquedaEmpleados();
                        _menusBusqueda.InitializeComponent();
                        this.Close();
                        _menusBusqueda.Show();
                    }
                }
            }
            else
            {

                bool result = enviarCorreo.EnviarDatosCorreo(txt_destinatario.Text, txt_subject.Text, txt_message.Text,txt_cc.Text, ventanaCurruculumCandidatos.ReportViewerCurriculum, ref error);

                if (!result)
                {
                    MessageBox.Show("Ocurrio un error al adjuntar y enviar el correo" + error);
                }
                else
                {
                    MessageBoxResult MsCorreo = MessageBox.Show("El curriculum fue enviado con éxito.", "MENSAJE DE CONFIRMACION", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                    if (MsCorreo == MessageBoxResult.OK)
                    {
                        Busqueda _menusBusqueda = new Busqueda();
                        _menusBusqueda.InitializeComponent();
                        this.Close();
                        _menusBusqueda.Show();
                    }
               }
            }
        }
 private void lab_menuCreacionPerf_MouseDown(object sender, MouseButtonEventArgs e)
 {
     //EVENTO PARA REDIRECCIONAR AL FORMULARIO DE EMPLEADO
     BusquedaEmpleados _busEmple = new BusquedaEmpleados();
     _busEmple.InitializeComponent();
     this.Close();
     _busEmple.Show();
 }
 private void Label_MouseDown_1(object sender, MouseButtonEventArgs e)
 {
     BusquedaEmpleados _busEmple = new BusquedaEmpleados();
     _busEmple.InitializeComponent();
     this.Close();
     _busEmple.Show();
 }
        private void btn_UPDATE_Empresa_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txt_UPDATEnombreEmpresa.Text)| string.IsNullOrEmpty(txt_UPDATEdireccion.Text))
            {
                MessageBox.Show("Complete Todos los campos", "", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                //PARAMETROS PARA ACTUALIZAR

                EmpresaE _ActualizarEmpresaE = new EmpresaE();
                _ActualizarEmpresaE.id_empresa = Convert.ToInt32(listaData[0]);
                _ActualizarEmpresaE.nombre = txt_UPDATEnombreEmpresa.Text.ToUpper();
                _ActualizarEmpresaE.direccion = txt_UPDATEdireccion.Text.ToUpper();
                _ActualizarEmpresaE.correoEmpresa = txt_UPDATEcorreo.Text;
                _ActualizarEmpresaE.telefono = txt_UPDATEtelefono.Text.ToUpper();
                _ActualizarEmpresaE.id_pais = new PaisE();
                _ActualizarEmpresaE.id_pais.id_pais = Convert.ToInt32(cb_UPDATEpais.SelectedValue);

                string oerro = "";

                int returupdateEmpresa = 0;
                returupdateEmpresa = _empresaActualizarBL.updateEmpresas(_ActualizarEmpresaE, ref oerro);
                if (returupdateEmpresa > 0)
                {
                    MessageBox.Show("Registro fue actualziado con exito..", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);

                    BusquedaEmpleados _bw = new BusquedaEmpleados();
                    _bw.InitializeComponent();
                    this.Close();
                    _bw.ShowDialog();
                }
            }
        }
        private void btn_ActualizarInfoBasica_Click(object sender, RoutedEventArgs e)
        {
            if (!(string.IsNullOrEmpty(txtNombreInfBasica.Text) || string.IsNullOrEmpty(DateFechNacInfoBasica.Text) || string.IsNullOrEmpty(txtNombreInfBasica.Text) || (string.IsNullOrEmpty(cbDeptos.Text)) ||
                   (string.IsNullOrEmpty(cbMunic.Text)) || (string.IsNullOrEmpty(cb_profesionesIB.Text)) || (string.IsNullOrEmpty(cbSitLab.Text)) || (string.IsNullOrEmpty(txtTeNocelularInfBasica.Text)) ||
                   (string.IsNullOrEmpty(txtCorreoInfBasica.Text)) || (string.IsNullOrEmpty(txtNoduiInfBasica.Text)) || (string.IsNullOrEmpty(txtNnitInfBasica.Text))
                   ))
            {
                if (DateTime.Compare(DateTime.Now.Date, DateFechNacInfoBasica.SelectedDate.Value.Date) > 0)
                {
                    InfoBasicaE _InfoBasicaE = new InfoBasicaE();
                    DateTime edad = DateFechNacInfoBasica.SelectedDate.Value;
                    _InfoBasicaE.id_candidato = int.Parse(idCandidato);
                    _InfoBasicaE.nombre = txtNombreInfBasica.Text.ToUpper();
                    _InfoBasicaE.nacionalidad = txtNacionalidadInfBasica.Text.ToUpper();
                    _InfoBasicaE.telefono_celular = txtTeNocelularInfBasica.Text.ToUpper();
                    _InfoBasicaE.telefono_fijo = txtTelefonoCasaInfBasica.Text.ToUpper();
                    //_InfoBasicaE.profesiones = cb_profesionesIB.Text.ToUpper();
                    _InfoBasicaE.id_profesiones = Convert.ToInt32(cb_profesionesIB.SelectedValue);
                    _InfoBasicaE.correo = txtCorreoInfBasica.Text;
                    _InfoBasicaE.fecha_nacimiento = DateFechNacInfoBasica.SelectedDate.Value;
                    _InfoBasicaE.direccion = txtLugarResidenciaInfBasica.Text.ToUpper();
                    _InfoBasicaE.FotoCandidato = _Imagen.OnlyName;
                    if (rbsexoM.IsChecked == true)
                    {
                        _InfoBasicaE.id_genero = 1;
                    }
                    else if (rbsexoF.IsChecked == true)
                    {
                        _InfoBasicaE.id_genero = 2;
                    }

                    _InfoBasicaE.DUI = txtNoduiInfBasica.Text;
                    _InfoBasicaE.NIT = txtNnitInfBasica.Text;
                    _InfoBasicaE.AFP = txtNafpInfBasica.Text;
                    _InfoBasicaE.ISSS = txtNiss.Text;
                    _InfoBasicaE.id_municipio = Convert.ToInt32(cbMunic.SelectedValue);
                    _InfoBasicaE.id_situacionProfesional = Convert.ToInt32(cbSitLab.SelectedValue);

                    string oerro = "";

                    int returinfobasica = 0;

                    #region Capturar imagen por genero
                    switch (_InfoBasicaE.id_genero)
                    {
                        case 1:
                            pMensaje = "el candidato";
                            pURL = string.IsNullOrEmpty(_Imagen.OnlyName) ? @"C:\Imagenes\Fotos\User_default\Userman.png" : @"C:\Imagenes\Fotos\" + _Imagen.OnlyName;
                            break;
                        case 2:
                            pMensaje = "la candidata";
                            pURL = string.IsNullOrEmpty(_Imagen.OnlyName) ? @"C:\Imagenes\Fotos\User_default\userwoman.png" : @"C:\Imagenes\Fotos\" + _Imagen.OnlyName;
                            break;
                    }
                    #endregion

                    /*proceso de eliminacion de imagen*/
                    if (pCapturaImagen == true)
                    {
                        ControlImagen.GuardarImagenEnRuta(_Imagen);
                        //
                        returinfobasica = _InfobasicaBL.ActualizarInfBasica(_InfoBasicaE, _InfoBasicaE.id_candidato, ref oerro);
                    }
                    else
                    {
                        returinfobasica = _InfobasicaBL.ActualizarInfBasica(_InfoBasicaE, _InfoBasicaE.id_candidato, ref oerro);
                    }
                    if (returinfobasica <= 0)
                    {
                        MessageBox.Show("Ocurrio un error y no se pudo actualizar al candidato", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        #region Mostrar mensaje personalizado

                        SimpleAlert simpleAlert = new SimpleAlert();
                        simpleAlert.Title = "Nuevo Registro";
                        simpleAlert.NamePeople = txtNombreInfBasica.Text;
                        simpleAlert.Url = pURL;

                        simpleAlert.Message = "Se ha modificado " + pMensaje;
                        simpleAlert.ShowDialog();

                        #region Redireccionamiento
                        BusquedaEmpleados _menusBusqueda = new BusquedaEmpleados();
                        _menusBusqueda.InitializeComponent();
                        this.Close();
                        _menusBusqueda.Show();

                        #endregion
                        #endregion
                    }
                }
                else
                {
                    MessageBox.Show("La fecha de nacimiento debe ser menor a la fecha actual.", "Error", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                //MessageBox.Show("El empleado "+_InfoBasicaE.nombre+ " fue actualizado", "Exito", MessageBoxButton.OK, MessageBoxImage.None);
            }
            else
            {
                MessageBox.Show("Asegurese de que los campos obligatorios no esten vacíos.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
 private void lab_menuCreacionPerf_MouseDown(object sender, MouseButtonEventArgs e)
 {
     BusquedaEmpleados _busEmple = new BusquedaEmpleados();
     _busEmple.InitializeComponent();
     this.Close();
     _busEmple.Show();
 }
 private void Label_MouseDown_2(object sender, MouseButtonEventArgs e)
 {
     //EVENTO PARA REDIRECCIONAR AL FORMULARIO DE MAINWINDOW
     BusquedaEmpleados _busEmple = new BusquedaEmpleados();
     _busEmple.InitializeComponent();
     this.Close();
     _busEmple.Show(); ;
 }
        private void btn_UPDATE_Usuario_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txt_update_constrasenaUsuario.Password)| string.IsNullOrEmpty(txt_update_nombreDelUsuario.Text))
            {
                MessageBox.Show("Complete todos los campos", "", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                //PARAMETROS PARA ACUTUALIZAR

                usuariosE _ActualizarUsuarioE = new usuariosE();
                _ActualizarUsuarioE.id_usuario = Convert.ToInt32(listData[0]);
                _ActualizarUsuarioE.contrasena = txt_update_constrasenaUsuario.Password.ToString();
                _ActualizarUsuarioE.name = txt_update_nombreDelUsuario.Text.ToUpper();
                _ActualizarUsuarioE.id_rol = new RolUsuarioE();
                _ActualizarUsuarioE.id_rol.id_rol = Convert.ToInt32(cb_update_tipoRol.SelectedValue);

                string oerro = "";

                int returiupdateUsuario = 0;
                returiupdateUsuario = _usuariosActulaizarBL.UpdateUsuarios(_ActualizarUsuarioE, ref oerro);
                if (returiupdateUsuario > 0)
                {
                    MessageBox.Show("Registro fue actualizado con exito..", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);

                    BusquedaEmpleados _bw = new BusquedaEmpleados();
                    _bw.InitializeComponent();
                    this.Close();
                    _bw.ShowDialog();
                }

            }
        }
 private void btnRegresar_Click(object sender, RoutedEventArgs e)
 {
     BusquedaEmpleados busqueda = new BusquedaEmpleados();
     busqueda.InitializeComponent();
     busqueda.Show();
     this.Close();
 }