예제 #1
0
        private void bt_Home_Click(object sender, EventArgs e)
        {
            this.Hide();
            KyThi kythi = new KyThi();

            kythi.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (rdb_SV.Checked)
            {
                if (checkAccount("select * from SINHVIEN where MSSV = @username and matKhau = @password"))
                {
                    Program.student.MSUser1   = ds.Tables["Account"].Rows[0][0].ToString();
                    Program.student.Password1 = ds.Tables["Account"].Rows[0][1].ToString();
                    Program.student.Name1     = ds.Tables["Account"].Rows[0][2].ToString();
                    Program.student.Lop1      = ds.Tables["Account"].Rows[0][3].ToString();

                    MessageBox.Show("Login Successful!");
                    this.Hide();
                    DangnhapSV dangnhapSV = new DangnhapSV();
                    dangnhapSV.Show();
                }
                else
                {
                    MessageBox.Show("MSSV or Password of Sinh Vien is Wrong!!!");
                }
            }
            else
            {
                if (checkAccount("select * from GIAOVIEN where MSGV = @username and matKhau = @password"))
                {
                    Program.teacher.MSUser1   = ds.Tables["Account"].Rows[0][0].ToString();
                    Program.teacher.Password1 = ds.Tables["Account"].Rows[0][1].ToString();
                    Program.teacher.Name1     = ds.Tables["Account"].Rows[0][2].ToString();

                    MessageBox.Show("Login Successful!");
                    this.Hide();

                    KyThi kyThi = new KyThi();
                    kyThi.Show();
                }
                else
                {
                    MessageBox.Show("MSSV or Password of Giao Vien is Wrong!!!");
                }
            }
        }