private void BtnBuscar_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(TxtNomina.Text) && TxtNomina.Text != "Ingrese nomina...")
            {
                Nomina = Convert.ToInt32(TxtNomina.Text);

                DtRegistro = Consulta.EmpleadoEnviarCorreo(Nomina);
                if (DtRegistro.Rows.Count > 0)
                {
                    Correo = DtRegistro.Rows[0]["Correo"].ToString();
                    if (Soporte.ValidarMail(Correo))
                    {
                        Contraseña     = Encryption.Decrypt(DtRegistro.Rows[0]["Contraseña"].ToString());
                        NombreCompleto = DtRegistro.Rows[0]["Nombre"].ToString();
                        Usuario        = DtRegistro.Rows[0]["Usuario_Name"].ToString();

                        //Proceso de Enviar Correo
                        richTextBox1.Text = richTextBox1.Text.Replace("@Contradeseña", Contraseña);
                        richTextBox1.Text = richTextBox1.Text.Replace("@Empleado", NombreCompleto);

                        EnviarCorreo("*****@*****.**", "38641rene", richTextBox1.Text, "Recuperacion", Correo, "");
                        Close();
                    }
                }
                else
                {
                    Soporte.MsgError("No se encontraron datos con este numero de nomina", "Sin Registros");
                }
            }
            else
            {
                Soporte.Msg_Alerta("Igrese el numero de nomina");
            }
        }
Beispiel #2
0
        private bool ValidarDatos()
        {
            if (EsEditar)
            {
                if (IdEmpresa == 0)
                {
                    return(false);
                }
            }


            if (Soporte.ValidarMail(TxtCorreoEmpresa.Text) == false)
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        private bool ValidarCampos()
        {
            if (string.IsNullOrEmpty(TxtNomina.Text) || TxtNomina.Text == "Nomina...")
            {
                Soporte.MsgInformacion("Ingrese Numero de nomina para buscar sus Datos");
                TxtNomina.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TxtUser_Name.Text) || TxtUser_Name.Text == "User Name...")
            {
                Soporte.MsgInformacion("Ingrese un Nombre de Usuario para continuar");
                TxtUser_Name.Focus();
                return(false);
            }


            if (string.IsNullOrEmpty(txtContraseñaName.Text) || txtContraseñaName.Text == "Contraseña...")
            {
                Soporte.MsgInformacion("Falta ingresar la Contraseña.");
                txtContraseñaName.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(TxtContraConfirmar.Text) || TxtContraConfirmar.Text == "Confirmar Contraseña...")
            {
                Soporte.MsgInformacion("Confirme la contraseña para poder continuar.");
                TxtContraConfirmar.Focus();
                TxtContraConfirmar.SelectAll();
            }

            if (txtContraseñaName.Text != TxtContraConfirmar.Text)
            {
                Soporte.MsgInformacion("Las Contraseñas no coinciden favor de revisar");
                TxtContraConfirmar.Focus();
                TxtContraConfirmar.SelectAll();
                return(false);
            }

            if (string.IsNullOrEmpty(TxtCorreon.Text))
            {
                TxtCorreon.Text = "*****@*****.**";
            }

            if (Soporte.ValidarMail(TxtCorreon.Text) == false)
            {
                Soporte.MsgInformacion("Correo no valido favor de revisar");
                TxtCorreon.Focus();
                TxtCorreon.SelectAll();
                return(false);
            }
            if (string.IsNullOrEmpty(TxtPin.Text) || TxtPin.Text == "PIN")
            {
                TxtPin.Text = "0";
            }
            if (string.IsNullOrEmpty(TxtPalabraSeguridad.Text) || TxtPalabraSeguridad.Text == "Palabra de Seguridad...")
            {
                TxtPalabraSeguridad.Text = "Sin Registro de Seguridad";
            }

            return(true);
        }
Beispiel #4
0
        private bool ValidarCampos()
        {
            //if (string.IsNullOrEmpty(TxtNomina.Text))
            //{
            //    Soporte.MsgInformacion("Ingrese el Numero de Nomina");
            //    return false;
            //}

            if (string.IsNullOrEmpty(TxtNombres.Text))
            {
                Soporte.MsgInformacion("Ingrese un Nombre del Empleado");
                return(false);
            }
            if (string.IsNullOrEmpty(TxtApPaterno.Text))
            {
                Soporte.MsgInformacion("Ingrese el Apellido Paterno del Empleado");
                return(false);
            }
            if (string.IsNullOrEmpty(TxtApMaterno.Text))
            {
                Soporte.MsgInformacion("Ingrese el Apellido Materno del Empleado");
                return(false);
            }
            if (string.IsNullOrEmpty(TxtCURP.Text))
            {
                TxtCURP.Text = "Sin Registro";
            }
            if (string.IsNullOrEmpty(TxtRFC.Text))
            {
                TxtRFC.Text = "Sin Registro";
            }
            if (string.IsNullOrEmpty(TxtTelefono.Text))
            {
                TxtTelefono.Text = "0";
            }
            if (string.IsNullOrEmpty(TxtCelular.Text))
            {
                TxtCelular.Text = "0";
            }
            if (string.IsNullOrEmpty(TxtEmail.Text))
            {
                TxtEmail.Text = "*****@*****.**";
            }

            if (CmbAreas.SelectedIndex == 0)
            {
                Soporte.MsgInformacion("Seleccione un Area");
                return(false);
            }

            if (string.IsNullOrEmpty(CmbPuesto.Text))
            {
                Soporte.MsgInformacion("Seleccione un Puesto para el Empleado");
                return(false);
            }

            if (CmbPuesto.SelectedIndex == 0)
            {
                Soporte.MsgInformacion("Seleccione un Puesto para el Empleado");
                return(false);
            }

            if (string.IsNullOrEmpty(CmbEstatus.Text))
            {
                Soporte.MsgInformacion("Seleccione el estatus del Empleado");
                return(false);
            }

            if (CmbEstatus.SelectedIndex == 0)
            {
                Soporte.MsgInformacion("Seleccione el estatus del Empleado");
                return(false);
            }

            if (string.IsNullOrEmpty(TxtCalle.Text))
            {
                TxtCalle.Text = "Registro Pendiente";
            }

            if (string.IsNullOrEmpty(TxtNumInterno.Text))
            {
                TxtNumInterno.Text = "0";
            }
            if (string.IsNullOrEmpty(TxtNumExterno.Text))
            {
                TxtNumExterno.Text = "0";
            }

            if (string.IsNullOrEmpty(TxtEntreCalles.Text))
            {
                TxtEntreCalles.Text = "Registro Pendiente";
            }


            if (CmbxPais.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione el Pais.");
                return(false);
            }

            if (CmbxEstado.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Estado");
                return(false);
            }
            if (CmbxMunicipio.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Municipio");
                return(false);
            }

            if (CmbColonias.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una Colonia");
                return(false);
            }

            if (string.IsNullOrEmpty(TxtCodigoPostal.Text))
            {
                TxtCodigoPostal.Text = "0";
            }



            if (Soporte.ValidarMail(TxtEmail.Text) == false)
            {
                Soporte.MsgInformacion("Correo no valido");
                TxtEmail.Focus();
                TxtEmail.SelectAll();
                return(false);
            }

            if (CmbEmpresa.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una Empresa");
                return(false);
            }

            if (CmbSucursal.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una Sucursal.");
                return(false);
            }


            return(true);
        }
Beispiel #5
0
        private bool ValidarCampos()
        {
            if (Editar)
            {
                if (IdSucursal == 0)
                {
                    Soporte.MsgError("Seleccione un registro al que desea Actualizar.");
                    TxtNombre.Focus();
                    return(false);
                }
            }


            if (string.IsNullOrEmpty(TxtNombre.Text) || TxtNombre.Text == "0")
            {
                Soporte.MsgError("Ingrese Nombre de la Sucursal");
                TxtNombre.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TxtTelefono.Text) || TxtTelefono.Text == "0")
            {
                Telefono = "Registro Pendiente";
            }

            if (string.IsNullOrEmpty(TxtCorreo.Text) || TxtCorreo.Text == "0")
            {
                Correo = "*****@*****.**";
            }
            else
            {
                if (Soporte.ValidarMail(TxtCorreo.Text) == false)
                {
                    Soporte.MsgError("El correo no cuenta con el Formato correcto");
                    TxtCorreo.Focus();
                    TxtCorreo.SelectAll();
                    return(false);
                }
            }

            if (CmbEmpresa.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una empresa al que pertenecera la Sucursal");
                CmbEmpresa.Focus();
                CmbEmpresa.SelectAll();
                return(false);
            }
            if (CmbxPais.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Pais");
                CmbxPais.Focus();
                CmbxPais.SelectAll();
                return(false);
            }
            if (CmbxEstado.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Estado");
                CmbxEstado.Focus();
                CmbxEstado.SelectAll();
                return(false);
            }
            if (CmbxMunicipio.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Municipio");
                CmbxMunicipio.Focus();
                CmbxMunicipio.SelectAll();
                return(false);
            }

            if (CmbColonias.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una Colonia");
                CmbColonias.Focus();
                CmbColonias.SelectAll();
                return(false);
            }
            if (TxtCodigoPostal.TextLength < 4)
            {
                Soporte.MsgError("Ingrse un Codigo Postal Valido.");
                TxtCodigoPostal.Focus();
                return(false);
            }
            if (TxtCalle.TextLength < 5)
            {
                Soporte.MsgError("Ingrse una calle valido");
                TxtCalle.Focus();

                return(false);
            }
            if (string.IsNullOrEmpty(TxtEntreCalles.Text) || TxtEntreCalles.Text == "0")
            {
                Entre_Calles = "Sin Registro";
            }
            if (string.IsNullOrEmpty(TxtNumExterno.Text) || TxtNumExterno.Text == "0")
            {
                Numero_Externo = "SIN NUMERO";
            }

            if (string.IsNullOrEmpty(TxtNumInterno.Text) || TxtNumInterno.Text == "0")
            {
                Numero_Interno = "SIN NUMERO";
            }

            return(true);
        }