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(); }
private void newVehicle_Click(object sender, EventArgs e) { Vihecal vs = new Vihecal(); vs.ShowDialog(); setvozila(); }