示例#1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (!(trackBar1.Value == 3))
     {
         Form33 f = new Form33();
         this.Hide();
         f.ShowDialog();
         Close();
     }
     else
     {
         MessageBox.Show("Надо ответить на вопрос", "Заголовок", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string SqlText = "INSERT INTO [Obsl] ([Obsl_ID], [Litak_ID],[date],[Stan],[Personal_ID]) VALUES (1,1, '01:01:2018','good',1) ";
            Form33 f       = new Form33(); // створити екземпляр вікна

            if (f.ShowDialog() == DialogResult.OK)
            {
                // сформувати SQL-рядок
                SqlText = "INSERT INTO [Obsl] ([Obsl_ID], [Litak_ID],[date],[Stan],[Personal_ID]) VALUES (";
                SqlText = SqlText + "\'" + f.textBox1.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox2.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox3.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox4.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox5.Text + "\')";



                // виконати SQL-команду
                MyExecuteNonQuery(SqlText);
                // відобразати таблицю Source
                Obsl();
            }
        }