Пример #1
0
        private void editVehicle_Click(object sender, EventArgs e)
        {
            if (dataGridView1.DataSource == null)
            {
                return;
            }

            var         vs = dataGridView1.SelectedRows[0].DataBoundItem as Vehical;
            VihecalType tp = new VihecalType();

            if (typeof(Bus) == vs.GetType())
            {
                tp.name = "Bus";
            }
            else if (typeof(Vagon) == vs.GetType())
            {
                tp.name = "Vagon";
            }
            else if (typeof(Locomotiva) == vs.GetType())
            {
                tp.name = "Voz";
            }


            Vihecal fvs = new Vihecal(vs, tp);

            fvs.ShowDialog();

            setvozila();
        }
Пример #2
0
        private void newVehicle_Click(object sender, EventArgs e)
        {
            Vihecal vs = new Vihecal();

            vs.ShowDialog();

            setvozila();
        }