Exemple #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if ((!radioButton1.Checked) && (!radioButton2.Checked) && (!radioButton3.Checked) && (!radioButton4.Checked))
     {
         MessageBox.Show("Надо ответить на вопрос", "Заголовок", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else if (radioButton2.Checked)
     {
         MessageBox.Show("Вы ответили правильно", "Заголовок", MessageBoxButtons.OK, MessageBoxIcon.Information);
         radioButton1.Enabled = false;
         radioButton2.Enabled = false;
         radioButton3.Enabled = false;
         radioButton4.Enabled = false;
         Class1.massiv(7, 1);
         Form27 f = new Form27();
         this.Hide();
         f.ShowDialog();
         Close();
     }
     else
     {
         MessageBox.Show("Вы ответили правильно", "Заголовок", MessageBoxButtons.OK, MessageBoxIcon.Information);
         radioButton1.Enabled = false;
         radioButton2.Enabled = false;
         radioButton3.Enabled = false;
         radioButton4.Enabled = false;
         Class1.massiv(7, 0);
         Form27 f = new Form27();
         this.Hide();
         f.ShowDialog();
         Close();
     }
 }
Exemple #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            int    index, n;
            string SqlText = "UPDATE [Posada] SET ";
            string Posada_ID, NazvaPosady;

            // перевірка, чи є взагалі записи в таблиці Source
            n = dataGridView1.Rows.Count;
            if (n == 1)
            {
                return;
            }

            Form27 f = new Form27();

            // заповнити форму даними перед відкриттям
            index       = dataGridView1.CurrentRow.Index;
            Posada_ID   = dataGridView1[0, index].Value.ToString();
            NazvaPosady = dataGridView1[0, index].Value.ToString();


            f.textBox1.Text = NazvaPosady;


            if (f.ShowDialog() == DialogResult.OK)
            {
                NazvaPosady = f.textBox1.Text;


                SqlText += "Surname = \'" + NazvaPosady + "";
                SqlText += "WHERE [Posada].Posada_ID = " + Posada_ID;
                MyExecuteNonQuery(SqlText);
                Posada();
            }
        }