Exemplo n.º 1
0
        private void btnCreatExam_Click(object sender, EventArgs e)
        {
            string     examcode = txtExamcode.Text;
            string     date     = dtDate.Text;
            ManageExam model    = new ManageExam();

            if (model.AddNewExam(examcode, date))
            {
                foreach (var item in list)
                {
                    model.AddExamDetail(examcode, item.ID);
                }
                MessageBox.Show("Add New Success");
            }
            else
            {
                MessageBox.Show("Add Failed");
            }
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ManageExam md   = new ManageExam();
            string     type = cbSubjec1.SelectedItem.ToString();

            if (type.Equals("english"))
            {
                type = "TN1";
            }
            if (type.Equals("macth"))
            {
                type = "TN2";
            }
            if (type.Equals("history"))
            {
                type = "TN3";
            }
            list = md.GetQuestions(type);
            MessageBox.Show("Load Questions Success");
            btnCreatExam.Enabled = true;
        }