Example #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();
            q = "select * from student_record where std_batchcode='" + comboBox1.SelectedValue.ToString() + "'";

            viewclass vc2 = new viewclass(q);

            dataGridView1.DataSource = vc2.showrecord();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            student s = new student();

            s.std_name      = textBox1.Text;
            s.std_USN       = textBox2.Text;
            s.std_contact   = textBox3.Text;
            s.std_sem       = textBox4.Text;
            s.std_sec       = textBox5.Text;
            s.std_batchcode = textBox6.Text;
            s.std_password  = textBox7.Text;

            s.std_ad_id = AdminLogin.fk_ad;


            insertclass ic = new insertclass();

            string msg = ic.insert_student(s);

            MessageBox.Show(msg);
        }
Example #3
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_sub    = comboBox1.SelectedValue.ToString();

            insertclass ic = new insertclass();

            string msg = ic.insert_questions(q);

            MessageBox.Show(msg);
            textbox();
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            C++;


            if (radioButton1.Checked == true)
            {
                selectedvalue = radioButton1.Text;
            }
            else if (radioButton2.Checked == true)
            {
                selectedvalue = radioButton2.Text;
            }
            else if (radioButton3.Checked == true)
            {
                selectedvalue = radioButton3.Text;
            }
            else if (radioButton4.Checked == true)
            {
                selectedvalue = radioButton4.Text;
            }
            else
            {
                MessageBox.Show("please select one option!");
            }

            if (selectedvalue.Equals(correctop))
            {
                score++;
                label3.Text = score.ToString();
            }

            s            = rc.scalarReturn("select min(q_id) from questions where q_id>" + i + "and q_fk_sub=" + studentlogin.exam_id);
            lastquestion = rc.scalarReturn("select max(q_id) from questions where q_id>" + i + "and q_fk_sub=" + studentlogin.exam_id);
            if (s.Equals(""))
            {
                MessageBox.Show("quiz over!");
                button1.Enabled = false;

                if (lastquestion.Equals(s))
                {
                    insertclass IC = new insertclass();
                    IC.insert_score(score, studentlogin.studentid, studentlogin.exam_id);


                    this.Enabled = false;
                    messageform mf = new messageform();
                    mf.Show();
                }
            }
            else
            {
                i = Convert.ToInt32(s);

                label1.Text       = rc.scalarReturn("select q_title from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
                radioButton1.Text = rc.scalarReturn("select q_opa from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
                radioButton2.Text = rc.scalarReturn("select q_opb from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
                radioButton3.Text = rc.scalarReturn("select q_opc from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
                radioButton4.Text = rc.scalarReturn("select q_opd from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
                correctop         = rc.scalarReturn("select q_opcorrect from questions where q_id=" + i + "and q_fk_sub=" + studentlogin.exam_id);
            }



            radiobtn();
        }