Exemple #1
0
        private void btnSearchQE_Click(object sender, EventArgs e)
        {
            string      id = txtSearchQE.Text;
            Manage_Exam me = new Manage_Exam();

            dataGridView2.DataSource = me.SearchByIDQE(id);
        }
Exemple #2
0
        private void btnRandom_Click(object sender, EventArgs e)
        {
            Manage_Exam me  = new Manage_Exam();
            string      sid = cbSubjectQE.SelectedItem.ToString();

            if (sid.Equals("Topnotch 1"))
            {
                sid = "TN1";
            }
            if (sid.Equals("Topnotch 2"))
            {
                sid = "TN2";
            }
            if (sid.Equals("Topnotch 3"))
            {
                sid = "TN3";
            }
            if (sid.Equals("Summit 1"))
            {
                sid = "SUM1";
            }

            list = me.GetRandomQuestion(sid);
            MessageBox.Show("Load Question Success");
            btnCreateQE.Enabled = true;
        }
Exemple #3
0
        private void tabControl1_Click(object sender, EventArgs e)
        {
            AdminModel model = new AdminModel();

            dataGridView1.DataSource = model.GetQuestion();
            Manage_Exam me = new Manage_Exam();

            dataGridView2.DataSource = me.GetExam();
        }
Exemple #4
0
        private void btnUpdateQE_Click(object sender, EventArgs e)
        {
            string      id     = txtCheckExamCode.Text;
            string      date   = txtDateQE.Text;
            string      status = cbStatusQE.Text;
            Manage_Exam me     = new Manage_Exam();

            if (me.UpdateQE(id, date, status))
            {
                dataGridView2.DataSource = me.GetConnection();
                ResetGUI();
                MessageBox.Show("Update Success");
            }
            else
            {
                MessageBox.Show("Update Fail");
            }
        }
Exemple #5
0
        private void btnCreateQE_Click(object sender, EventArgs e)
        {
            string      ExamCode = txtCheckExamCode.Text;
            string      date     = txtDateQE.Text;
            Manage_Exam me       = new Manage_Exam();

            if (me.AddExam(ExamCode, date))
            {
                foreach (var item in list)
                {
                    me.AddExamDetail(ExamCode, item.id);
                }
                MessageBox.Show("Create success!");
            }
            else
            {
                MessageBox.Show("Create failed");
            }
        }