private void button1_Click(object sender, EventArgs e)
        {
            button1.FlatAppearance.BorderSize = 0;
            set SET = new set();

            this.Hide();
            SET.Show();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(richTextBox1.Text))
            {
                MessageBox.Show("Please Enter Question", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox4.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox5.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textBox6.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(comboBox1.Text))
            {
                MessageBox.Show("Please Enter All Details", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            double f;

            //  questiontime qt = new questiontime();
            if (double.Parse(textBox6.Text) > 0)
            {
                f = double.Parse(textBox6.Text) * -1;
            }
            else
            {
                f = double.Parse(textBox6.Text);
            }
            examTableAdapter2.InsertQuery(questiontime.examcode, examtime.ToString(), q, richTextBox1.Text.ToString(), textBox1.Text.ToString(), textBox2.Text.ToString(), textBox3.Text.ToString(), textBox4.Text.ToString(), comboBox1.Text.ToString(), int.Parse(textBox5.Text), f);
            richTextBox1.Text = "";
            textBox1.Text     = "";
            textBox2.Text     = "";
            textBox3.Text     = "";
            textBox4.Text     = "";
            textBox5.Text     = "";
            comboBox1.Text    = "a";
            q++;
            label8.Text = q.ToString();
            set refress = new set();

            refress.Ref();
        }