예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            InsertClass ic = new InsertClass();

            ic.insert_setquiz(System.DateTime.Now.ToShortDateString(), comboBox1.Text, comboBox4.Text);
            string    q3  = "select * from set_quiz";
            ViewClass vc3 = new ViewClass(q3);

            dataGridView3.DataSource = vc3.showrecord();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Questions q = new Questions();

            q.ques_title     = textBox1.Text;
            q.ques_option1   = textBox2.Text;
            q.ques_option2   = textBox3.Text;
            q.ques_option3   = textBox4.Text;
            q.ques_option4   = textBox5.Text;
            q.ques_correct   = textBox6.Text;
            q.ques_addeddate = System.DateTime.Now.ToShortDateString();
            q.ques_fk_admin  = AdminLogin.fk_ad;
            q.ques_fk_quiz   = comboBox1.SelectedValue.ToString();
            InsertClass ic  = new InsertClass();
            string      msg = ic.insert_srecord(q);

            MessageBox.Show(msg + " " + q.ToString() + " " + comboBox1.SelectedValue.ToString());
        }