Exemple #1
0
        void Button2Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "Eduardo")
            {
                MessageBox.Show("Usuario incorrecto!!!", "ERROR");
            }

            else if (textBox2.Text != "Cutonala")
            {
                MessageBox.Show("Contraseña incorrecta!!!", "ERROR");
            }
            else if (comboBox1.Text == "")
            {
                MessageBox.Show("Seleccione tipo de usuario valido!!!", "ERROR");
            }
            else if (comboBox1.Text == "Administrador")
            {
                Admin frm3 = new Admin();
                frm3.Show();
                this.Hide();
            }
            else if (comboBox1.Text == "Cajero")
            {
                Cajero frm = new Cajero();
                frm.Show();
                this.Hide();
            }
            else if (comboBox1.Text == "Soporte tecnico")
            {
                SuperUsuario frm2 = new SuperUsuario();
                frm2.Show();
                this.Hide();
            }
        }
        void Button2Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Realmente quieres cerrar sesión?", "AVISO",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes) {

                MainForm frm1 = new MainForm();
                this.Hide();
                frm1.Show();
            }
            else{
                SuperUsuario frm5 = new SuperUsuario(this.usuario);
                this.Hide();
                frm5.Show();
            }
        }
Exemple #3
0
 void Button2Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Realmente quieres cerrar sesión?", "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         MainForm frm1 = new MainForm();
         this.Hide();
         frm1.Show();
     }
     else
     {
         SuperUsuario frm5 = new SuperUsuario(this.usuario);
         this.Hide();
         frm5.Show();
     }
 }
Exemple #4
0
        void ValidacionUsuario()
        {
            string query    = "";
            string usuario  = textBox1.Text.Trim();
            string password = textBox2.Text.Trim();
            string tipo     = comboBox1.Text;
            Hash   hash     = new Hash();

            password = hash.GetMd5Hash(password);
            LoginMySql consulta = new LoginMySql();

            query = consulta.queryUsuario(usuario, password, tipo);
            if (query.Length == 0)
            {
                MessageBox.Show("Datos incorrectos", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                textBox1.Focus();
            }
            if (query.Length > 0 && tipo == "Administrador")
            {
                Admin frm3 = new Admin(query);
                frm3.Show();
                this.Hide();
            }
            if (query.Length > 0 && tipo == "Cajero")
            {
                Cajero frm = new Cajero(query);
                frm.Show();
                this.Hide();
            }
            if (query.Length > 0 && tipo == "Soporte tecnico")
            {
                SuperUsuario frm2 = new SuperUsuario(query);
                frm2.Show();
                this.Hide();
            }
        }
Exemple #5
0
        void ValidacionUsuario()
        {
            string query = "";
            string usuario = textBox1.Text.Trim();
            string password = textBox2.Text.Trim();
            string tipo = comboBox1.Text;
            Hash hash = new Hash();
            password = hash.GetMd5Hash(password);
            LoginMySql consulta = new LoginMySql();
            query = consulta.queryUsuario(usuario, password, tipo);
            if(query.Length == 0)
            {
                MessageBox.Show("Datos incorrectos", "ADVERTENCIA", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                textBox1.Focus();
            }
            if(query.Length > 0 && tipo == "Administrador")
            {
                Admin frm3 = new Admin(query);
                frm3.Show();
                this.Hide();
            }
            if(query.Length > 0 && tipo == "Cajero"){
                Cajero frm = new Cajero(query);
                frm.Show();
                this.Hide();
            }
            if(query.Length > 0 && tipo == "Soporte tecnico") {
                SuperUsuario frm2 = new SuperUsuario(query);
                frm2.Show();
                this.Hide();

            }
        }