private void timer1_Tick(object sender, EventArgs e) { giay -= 1; if (giay < 0) { phut -= 1; giay = 59; } lbTimerPhut.Text = phut.ToString(); lbTimerGiay.Text = giay.ToString(); if (phut < 0) { if (loai == "ThiThu") { ChonDapAn(); double soDiem = TinhDiem(); int soCauDung = SoCauDung(); hocSinhBUS.AddKetQuaThiThu(hocSinhLogin.MaHocSinh, maDeDuocChon, maKhoiHS, soDiem); HetGioForm hetGio = new HetGioForm(hocSinhLogin, stopTimer, soDiem, soCauDung, phut, giay, loai); this.Hide(); hetGio.ShowDialog(); this.Close(); Application.Exit(); } if (loai == "Thi") { ChonDapAn(); double soDiem = TinhDiem(); int soCauDung = SoCauDung(); string maDeVaKhoiTrongKyThi = dsCauHoiThi[0].MaDeVaKhoiTrongKyThi; hocSinhBUS.AddKetQuaThi(hocSinhLogin.MaHocSinh, maDeVaKhoiTrongKyThi, soDiem); HetGioForm hetGio = new HetGioForm(hocSinhLogin, stopTimer, soDiem, soCauDung, phut, giay, loai); this.Hide(); hetGio.ShowDialog(); this.Close(); Application.Exit(); } } }