예제 #1
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            logUsuario ingresaUsuario = new logUsuario();
            bool       rol            = ingresaUsuario.Permisos(txtUsuario.Text, txtContrasena.Text);
            bool       ingreso        = ingresaUsuario.ingresar(txtUsuario.Text, txtContrasena.Text);

            if (ingreso == true & rol == true)
            {
                lblAccesoDenegado.Visible = false;

                frmPrincipal frmPrincipal = new frmPrincipal();
                frmPrincipal.Show();
                this.Hide();

                txtUsuario.Text    = "";
                txtContrasena.Text = "";
            }
            else if (ingreso == true & rol == false)
            {
                lblAccesoDenegado.Visible = false;
                frmPrincipal frmPrincipal = new frmPrincipal();
                frmPrincipal.Show();
                frmPrincipal.btnAlumnos.Location = new Point(564, 129);

                frmPrincipal.btnCobros.Visible   = false;
                frmPrincipal.btnDocentes.Visible = false;
                // frmPrincipal.btnInformes.Visible = false;
                frmPrincipal.btnUsuarios.Visible = false;
                frmPrincipal.btnSalas.Visible    = false;

                this.Hide();
                txtUsuario.Text    = "";
                txtContrasena.Text = "";
            }
            else
            {
                lblAccesoDenegado.Visible = true;
            }
        }
예제 #2
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            logUsuario ingresaUsuario = new logUsuario();

            bool ingreso = ingresaUsuario.ingresar(txtUsuario.Text, txtContrasena.Text);

            if (ingreso == true)
            {
                lblAccesoDenegado.Visible = false;

                frmPrincipal frmPrincipal = new frmPrincipal();
                frmPrincipal.Show();
                this.Hide();

                txtUsuario.Text    = "";
                txtContrasena.Text = "";
            }
            else
            {
                lblAccesoDenegado.Visible = true;
            }
        }