예제 #1
0
        private void btnQuayLai_Click(object sender, EventArgs e)
        {
            HocSinhGUI hocSinhGUI = new HocSinhGUI(hocSinhLogin);

            this.Hide();
            hocSinhGUI.ShowDialog();
            this.Close();
            Application.Exit();
        }
        private void btnBoBai_Click(object sender, EventArgs e)
        {
            DialogResult kq = MessageBox.Show("Bạn có chắc muốn bỏ bài thi? Bài thi này sẽ không được ghi vào trong lịch sử thi!", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (kq == DialogResult.Yes)
            {
                HocSinhGUI hocSinh = new HocSinhGUI(hocSinhLogin);
                this.Hide();
                hocSinh.ShowDialog();
                this.Close();
                Application.Exit();
            }
            else
            {
                return;
            }
        }
예제 #3
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            DTO.HT.GiaoVien temp = giaoVienBUS_HT.findGiaoVien(tbEmail.Text, tbMatKhau.Text);

            if (temp != null)
            {
                GiaoVienGUI giaoVien = new GiaoVienGUI(temp);
                this.Hide();
                giaoVien.ShowDialog();
                this.Close();
                Application.Exit();
            }
            else
            {
                //học sinh
                HocSinhBUS hocSinhBUS = new HocSinhBUS();
                try
                {
                    HocSinh hocSinh = hocSinhBUS.FindOneHocSinh(tbEmail.Text, tbMatKhau.Text);

                    if (hocSinh != null)
                    {
                        HocSinhGUI hocSinhGUI = new HocSinhGUI(hocSinh);
                        this.Hide();
                        hocSinhGUI.ShowDialog();
                        this.Close();
                        Application.Exit();
                    }
                    else
                    {
                        MessageBox.Show("Bạn đã nhập không chính xác Email hoặc mật khẩu . Xin mời nhập lại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                catch (Exception Ex)
                {
                    MessageBox.Show(Ex.Message, "Exception Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }