コード例 #1
0
ファイル: DangkyThi.cs プロジェクト: ssnncc/Thi-Trac-Nghiem
        private void btnThiThu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Program.mMalop  = txtMaLop.Text;
            Program.ngayThi = dtNgaythi.Text;

            string malop = Program.mMalop.Trim();

            Program.maMH = txtMaMH.Text;
            string mamh        = Program.maMH;
            string trinhdo     = "";
            int    socauthi    = -1;
            int    thoigianthi = -1;
            string manv        = "";

            Program.KetNoi();
            string        query = "EXEC SP_GET_DK_THI '" + malop + "','" + Program.maMH + "','" + Program.ngayThi + "'";
            SqlDataReader dkthi = Program.ExecSqlDataReader(query);

            if (dkthi == null)
            {
                MessageBox.Show("Đợt thi này không tồn tại trong hệ thống");
            }
            else
            {
                bool c = dkthi.Read();
                if (c == false)
                {
                    MessageBox.Show("Đợt thi này đã không còn tồn tại trong hệ thống! ");
                    return;
                }
                trinhdo      = dkthi.GetString(4).Trim();
                socauthi     = dkthi.GetInt32(6);
                thoigianthi  = dkthi.GetInt32(5);
                manv         = dkthi.GetString(3);
                Program.iddk = dkthi.GetInt32(7);
                Dangky dk = new Dangky(
                    mamh,                            //mamon
                    malop,                           //malop
                    DateTime.Parse(Program.ngayThi), //ngaythi
                    manv,                            //manv
                    trinhdo,
                    thoigianthi,
                    socauthi
                    );
                dkthi.Close();
                DataTable db         = Program.ExecSqlDataTable("EXEC SP_GET_DE_THI '" + Program.maMH + "','" + trinhdo + "'," + socauthi + "");
                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
                {
                    Dangky.dangky = dk;
                    this.Close();
                    List <BoDe> list = convertToListBD(db);
                    BoDe.boDe = list;
                    ThiThu form = new ThiThu();
                    form.ShowDialog();
                }
            }
        }
コード例 #2
0
ファイル: DangkyThi.cs プロジェクト: ssnncc/Thi-Trac-Nghiem
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ThiThu thithu = new ThiThu();

            thithu.Show();
        }