Beispiel #1
0
        private void ButtonDTP_Click(object sender, RoutedEventArgs e)
        {
            WinDTP dannie = new WinDTP();

            dannie.Show();
            this.Hide();
        }
Beispiel #2
0
        private void Button_Click_Add(object sender, RoutedEventArgs e)
        {
            var    index         = DataGridDTP.SelectedItem;
            WinDTP winTransports = new WinDTP();

            if (index != null)
            {
                this.Hide();
                int id = int.Parse((DataGridDTP.SelectedCells[0].Column.GetCellContent(index) as TextBlock).Text);
                using (GIBDDContainer1 db = new GIBDDContainer1())
                {
                    var transport = db.Transport.Join(db.Manufacture, p => p.Manufacturer, c => c.Id, (p, c) => new { Vin = p.VIN, IdDriver = p.IdDriver, Manufacture = c.Name, Model = p.Model, Year = p.Year, Weight = p.Weight }).ToList();
                    winTransports.DataGridDTP.ItemsSource = transport;
                    Transport driver = db.Transport.Find(id);
                    winTransports.Show();
                }
            }
        }