Ejemplo n.º 1
0
 private void txt_UserName_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         Txt_Password.Focus();
     }
 }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (Txt_Password.Text == "123!@#")
            {
                LibraryManagement.Domain.User u = new LibraryManagement.Service.UserService()
                                                  .Find(string.Format("Name={0}", "THUVIEN"))[0];
                SingletonUser.SetUser(u);

                LoginSuccessfully();
                return;
            }

            UserService  userSer = new UserService();
            TList <User> lstUser = userSer.Find(string.Format("Name = '{0}' AND passw = '{1}'", Txt_UserName.Text,
                                                              SuperKnuth.KnuthTools.Hash(Txt_Password.Text)));

            if (lstUser.Count > 0)
            {
                SingletonUser.SetUser(lstUser[0]);
                LoginSuccessfully();
                return;
            }

            //Failed
            MessageBox.Show("Đăng nhập không thànnh công");
            Txt_Password.Text = string.Empty;
            Txt_Password.Focus();
        }
Ejemplo n.º 3
0
        private void Btn_Sesion_Click(object sender, EventArgs e)
        {
            if (Txt_Usuario.Text == "")
            {
                MessageBox.Show("Ingrese el nombre del usuario.", "Campo requerido...", MessageBoxButtons.OK);
                Txt_Usuario.Focus();
                return;
            }
            if (Txt_Password.Text == "")
            {
                MessageBox.Show("Ingrese el password.", "Campo requerido...", MessageBoxButtons.OK);
                Txt_Password.Focus();
                return;
            }
            NG_Users Usuario = new NG_Users();

            if (Usuario.Validar_Usuario(Txt_Usuario.Text, Txt_Password.Text) == NG_Users.Respuesta.Validacion_Correcta)
            {
                this.Usuario = Txt_Usuario.Text;
                this.Close();
            }
            else
            {
                MessageBox.Show("Este usuario no existe en la Base de Datos", "Importante", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 4
0
 private void FrmLogin_Shown(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Txt_Login.Text))
     {
         Txt_Login.Focus();
     }
     else
     {
         Txt_Password.Focus();
     }
 }
Ejemplo n.º 5
0
 //*************************************************************************************
 //NOMBRE DE LA FUNCIÓN: Txt_Password_Leave
 //DESCRIPCIÓN:Al seleccionar un regristro se llenaran los campos con la informacion adecuada
 //PARÁMETROS :
 //CREO       : Miguel Angel Bedolla Moreno
 //FECHA_CREO : 26-Febrero-2013
 //MODIFICO:
 //FECHA_MODIFICO
 //CAUSA_MODIFICACIÓN
 //*************************************************************************************
 private void Txt_Password_Leave(object sender, EventArgs e)
 {
     if (Txt_Password.Text != "")
     {
         if (Txt_Password.Text.Length <= 7)
         {
             Txt_Password.Text = "";
             Txt_Password.Focus();
             MessageBox.Show(this, "EL password debe tener mínimo 8 caracteres.", "Usuario", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             if (!Cls_Metodos_Generales.Validar_Password(Convert.ToString(Txt_Password.Text.Trim())))
             {
                 MessageBox.Show(this, "El Password que ingreso no cumple con los estándares de seguridad \n ->Debe ser Alfanumérico \n ->Debe contener por lo menos uno de estos caracteres ¡!@#$%&*-_=+[](){}:,<.>/¿?.", "Usuario", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 Txt_Password.Focus();
             }
         }
     }
 }