public void DeleteCocktailInDatabase(Cocktail cocktail) { dataContext.GetTable <Cocktail>().DeleteOnSubmit( (from elem in dataContext.GetTable <Cocktail>() where elem.Id == cocktail.Id select elem).First()); dataContext.SubmitChanges(); }
public void UpdateCocktailToDatabase(Cocktail cocktail) { Cocktail temp = (from elem in dataContext.GetTable <Cocktail>() where elem.Id == cocktail.Id select elem).First(); temp.Name = cocktail.Name; temp.Description = cocktail.Description; dataContext.SubmitChanges(); }
public void AddCocktailToDatabase(Cocktail cocktail) { dataContext.GetTable <Cocktail>().InsertOnSubmit(cocktail); dataContext.SubmitChanges(); }
partial void DeleteCocktail(Cocktail instance);
partial void UpdateCocktail(Cocktail instance);
partial void InsertCocktail(Cocktail instance);
public EditWindow(Cocktail cocktail) { InitializeComponent(); this.cocktail = cocktail; editMode = true; }