示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            insertclass ic = new insertclass();

            ic.insert_setexam(System.DateTime.Now.ToShortDateString(), textBox1.Text, comboBox2.SelectedValue.ToString());
            string    q  = "select * from set_exam";
            viewclass vc = new viewclass(q);

            dataGridView2.DataSource = vc.showrecord();
            viewclass vc2 = new viewclass(q);

            dataGridView1.DataSource = vc2.showrecord();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            questions q = new questions();

            q.q_title     = textBox1.Text;
            q.q_opa       = textBox2.Text;
            q.q_opb       = textBox3.Text;
            q.q_opc       = textBox4.Text;
            q.q_opd       = textBox5.Text;
            q.q_opcorrect = textBox6.Text;
            q.q_addeddate = System.DateTime.Now.ToShortDateString();
            q.q_fk_ad     = AdminLogin.fk_ad;
            q.q_fk_ex     = comboBox1.SelectedValue.ToString();

            insertclass ic  = new insertclass();
            string      msg = ic.insert_srecord(q);

            MessageBox.Show(msg);
        }