private void pictureBox7_Click(object sender, EventArgs e)
        {
            //volver a formulario pricipal soporte
            Perfil_Soporte entrarSoporte = new Perfil_Soporte();

            entrarSoporte.Show();

            //cerrar formulario al abrir otro
            this.Hide();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            CLASES.Dadministradores dadm  = new CLASES.Dadministradores();
            CLASES.ValidarAdm       valUs = new CLASES.ValidarAdm();

            if (txtusuario.Text != String.Empty && txtcontraseña.Text != String.Empty)
            {
                DataTable dt = new DataTable();

                dadm.set_usuario(txtusuario.Text);
                dadm.set_password(txtcontraseña.Text);
                dt = valUs.validar_administradores(dadm);

                if (dt.Rows.Count != 0)
                {
                    String nivel;
                    nivel = Convert.ToString(dt.Rows[0]["tipo_usuario"]);
                    if (nivel.Equals("Soporte"))
                    {
                        MessageBox.Show("Bienvenido " + txtusuario.Text);

                        //ocultar formulario al abrir otro
                        this.Hide();

                        Perfil_Soporte volverform = new Perfil_Soporte();
                        volverform.Show();
                    }
                    else if (nivel.Equals("Administrador"))
                    {
                        MessageBox.Show("Bienvenido " + txtusuario.Text);

                        //ocultar formulario al abrir otro
                        this.Hide();

                        Perfil_Administrador volverform = new Perfil_Administrador();
                        volverform.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Error de ingreso");
                }
            }
            else
            {
                MessageBox.Show("Ingrese sus datos");
            }
        }