var c = (customerDB)comboBox1.SelectedItem; newContact.Name = textBox_Contact_Name.Text.Trim(); newContact.Vorname = textbox_Contact_Firstname.Text.Trim(); newContact.FKKunde = c.PKCustomer; db.Contacts.Add(newContact); db.SaveChanges(); Close();
var b = (TArticle)comboBox_Article.SelectedItem; TPosition newPosition = new TPosition(); newPosition.FKArticle = b.PKArticle; newPosition.Quantity = (int)numericUpDown_Menge.Value; newPosition.Position = textBox_Position.Text; db.TPosition.Add(newPosition); db.SaveChanges(); Close();
comboBox_Article.SelectedItem
var b = comboBox_Article.SelectedItem; if(typeof(TArticle)==b.GetType()) { //further instructions }
customerDB
TArticle
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)