Beispiel #1
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            string pass = txtPass.Text;
            string log  = txtLog.Text;

            if (tgl_pa.Checked)
            {
                AlunoDAO adao  = new AlunoDAO();
                bool     check = adao.Login(log, pass);
                if (check)
                {
                    this.Hide();
                    Global.F1.Show();
                    Global.F1.ChangePermi();
                }
                else
                {
                    pcbLog.BackColor  = red;
                    pcbPass.BackColor = red;
                    lblErro.Visible   = true;
                    txtLog.Focus();
                    txtLog.SelectAll();
                    txtPass.Clear();
                }
            } //Login Aluno
            else
            {
                ProfessorDAO pro   = new ProfessorDAO();
                bool         check = pro.Login(log, pass);
                if (check)
                {
                    this.Hide();
                    Global.F1.Show();
                    Global.F1.ChangePermi();
                }
                else
                {
                    pcbLog.BackColor  = red;
                    pcbPass.BackColor = red;
                    lblErro.Visible   = true;
                    txtLog.Focus();
                    txtLog.SelectAll();
                    txtPass.Clear();
                }
            }
        }