private void pictureBox2_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.Trim() == "")
     {
         MessageBox.Show("Asegúrese de ingresar el Usuario");
         textBox1.Focus();
     }
     else if (textBox2.Text.Trim() == "")
     {
         MessageBox.Show("Asegúrese de ingresar la Contraseña");
         textBox2.Focus();
     }
     else
     {
         MessageBox.Show(">Bienvenido<");
         Principal f = new Principal();
         f.Show();
         this.Hide();
     }
     c = c + 1;
     if (c == 3)
     {
         MessageBox.Show("ERROR");
         c = 0;
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            loading++;
            if (toRight)
            {
                panel2.Left += 2;
            }
            else
            {
                panel2.Left -= 2;
            }
            if (panel2.Left < 0 || panel2.Left > 196)
            {
                toRight = !toRight;
            }

            this.Opacity -= .005;
            if (this.Opacity == 0)
            {
                timer1.Enabled = false;
                Principal main = new Principal();
                main.Show();
                this.Hide();
            }

            //if (loading > 800)
            //{
            //    timer1.Enabled = false;
            //    Principal main = new Principal();
            //    main.Show();
            //    this.Hide();
            //}
        }
Ejemplo n.º 3
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (tbContraseña.Text == "daw")
     {
         var principal = new Principal();
         principal.Padre = this;
         principal.Show();
         this.Hide();
     }
     else
     {
         lbContrseña.Text = "Contraseña equivocada";
     }
 }
Ejemplo n.º 4
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            String user = this.txt_user.Text;
             String pass = this.txt_password.Text;
             Conexion c = new Conexion();
             //verifica que la conexiòn se haya establecido
            if (Conexion.Success()) {
                //verifica que los datos del login sean correctos
                Login L = new Login(user, pass,c);
                if (Login.Success())
                {
                    Principal F1 = new Principal();
                    F1.Show();
                    this.Hide();
                    //se cierra la conexión
                    c.Close();
                }
                else { MessageBox.Show("Contaseña inválida"); }

            }
            else { MessageBox.Show("Imposible conectar a la base de datos"); }
        }