Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form14 f = new Form14();

            this.Hide();
            f.ShowDialog();
            Close();
        }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            int    index, n;
            string Reys_ID;
            string Litak_ID, Data, ChasVidpravlennya, MarshrutID, ChasPrybuttya;
            string SqlText = "DELETE FROM [Reys] WHERE [Reys].Reys_ID = ";

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

            Form14 f = new Form14();

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

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

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

            f.label2.Text = Reys_ID + " - " + Reys_ID + " - " + Litak_ID + " - " + Data + "-" + ChasVidpravlennya + "-" + MarshrutID + "-" + ChasPrybuttya;

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