private void btnThi_Click(object sender, EventArgs e)
        {
            if (isDKMoi == true)
            {
                if (!checkValidate())
                {
                    return;
                }
            }
            else
            {
                if (!checkDKEdit())
                {
                    return;
                }
            }

            MessageBox.Show("Vao thi nè! ");
            string malop       = cb_maLop.SelectedValue.ToString();
            string mamh        = cb_maMonHoc.SelectedValue.ToString();
            string lanthi      = spinEdit_lanthi.Text;
            string trinhdo     = cb_trinhdo.SelectedItem.ToString();
            int    socauthi    = Int32.Parse(spinEdit_cauhoi.Text);
            int    thoigianthi = Int32.Parse(spinEdit_thoigian.Text);

            DataTable db         = Program.ExecSqlDataTable("EXEC SP_GET_DE_THI " + socauthi + ",'" + mamh + "','" + trinhdo + "'");
            int       checkCount = db.Rows.Count;

            if (checkCount == 0)
            {
                MessageBox.Show("Số câu hỏi thi trong hệ thống không đáp ứng đủ để thi!");
            }
            else
            {
                GiaoVienDK gv = new GiaoVienDK(
                    Program.mUserId,
                    mamh,
                    malop,
                    trinhdo,
                    dt_ngaythi.DateTime,
                    int.Parse(lanthi),
                    socauthi,
                    thoigianthi
                    );
                GiaoVienDK.thithu = gv;
                List <BoDe> list = convertToListBD(db);
                BoDe.thithu = list;
                frmThiThu form = new frmThiThu();
                form.ShowDialog();
            }
        }
Beispiel #2
0
 public UCCBiThiThu(frmThiThu frmThiThu)
 {
     InitializeComponent();
     this.frmThiThu = frmThiThu;
 }