Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            this.Close();
            Form12 frm = new Form12(this.s, str_id);

            frm.ShowDialog();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form12 f = new Form12();

            this.Hide();
            f.ShowDialog();
            Close();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            int    index, n;
            string MarshrutID;
            string Kudy, Opys;
            string SqlText = "DELETE FROM [Marshrut] WHERE [Marshrut].MarshrutID = ";

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

            Form12 f = new Form12();

            index      = dataGridView1.CurrentRow.Index;
            MarshrutID = Convert.ToString(dataGridView1[0, index].Value);

            // сформувати SQL-команду
            SqlText = SqlText + MarshrutID;

            // заповнити інформаційну довідку у вікні Form5
            MarshrutID = Convert.ToString(dataGridView1[1, index].Value);
            Kudy       = Convert.ToString(dataGridView1[2, index].Value);
            Opys       = Convert.ToString(dataGridView1[2, index].Value);

            f.label2.Text = MarshrutID + " - " + MarshrutID + " - " + Kudy + " - " + Opys;

            if (f.ShowDialog() == DialogResult.OK) // вивести форму
            {
                // виконати SQL-команду
                MyExecuteNonQuery(SqlText);
                // відобразити таблицю Source
                Marshrut();
            }
        }