示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      user = textBox1.Text;
            string      password = textBox2.Text;
            string      userdb, passworddb;
            returnclass rc = new returnclass();

            userdb = rc.scalerReturn("select count(ad_id) from admin_authu where ad_user='******'");
            if (userdb.Equals("0"))
            {
                MessageBox.Show("Invalid User");
            }
            else
            {
                passworddb = rc.scalerReturn("select ad_password from admin_authu where ad_user='******'");
                if (passworddb.Equals(password))
                {
                    fk_ad = rc.scalerReturn("select ad_id from admin_authu where ad_user='******'");
                    Form2 f = new Form2();
                    f.Show();
                }
                else
                {
                    MessageBox.Show("Invalid User");
                }
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            user     = textBox1.Text;
            password = textBox2.Text;

            string      userdb, passworddb;
            returnclass rc = new returnclass();

            userdb = rc.scalerReturn("select count(std_id) from student_record where std_id='" + user + "'");

            if (userdb.Equals("0"))
            {
                MessageBox.Show("Invalid User Name");
            }
            else
            {
                passworddb = rc.scalerReturn("select std_password from student_record where std_id='" + user + "'");



                if (passworddb.Equals(password))
                {
                    string val = rc.scalerReturn("select count (std_id) from student_record where std_id=(select stu_id_fk from set_exam where stu_id_fk='" + textBox1.Text + "' and exam_id_fk='" + comboBox1.SelectedValue.ToString() + "')");
                    if (val.Equals("0"))
                    {
                        MessageBox.Show("NO Such Exam Set!");
                    }
                    else
                    {
                        exam_id = comboBox1.SelectedValue.ToString();
                        this.t1.Show(); //aur yahan pe uss composition waly variable ko access krlia hai aur form ko show krwa dia
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Password");
                }
            }
        }
示例#3
0
        private void test_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(connstring);

            label3.Text       = score.ToString();
            i                 = Convert.ToInt16(rc.scalerReturn("select min(q_id) from questions where q_fk_ex=" + studentlogin.exam_id));
            label1.Text       = rc.scalerReturn("select q_title from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
            radioButton1.Text = rc.scalerReturn("select q_opa from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
            radioButton2.Text = rc.scalerReturn("select q_opb from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
            radioButton3.Text = rc.scalerReturn("select q_opc from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
            radioButton4.Text = rc.scalerReturn("select q_opd from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
            correctop         = rc.scalerReturn("select q_opcorrect from questions where q_id=" + i + "and q_fk_ex=" + studentlogin.exam_id);
        }