예제 #1
0
 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();
 }
예제 #2
0
        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();
        }
예제 #3
0
 public void AddCocktailToDatabase(Cocktail cocktail)
 {
     dataContext.GetTable <Cocktail>().InsertOnSubmit(cocktail);
     dataContext.SubmitChanges();
 }
예제 #4
0
 partial void DeleteCocktail(Cocktail instance);
예제 #5
0
 partial void UpdateCocktail(Cocktail instance);
예제 #6
0
 partial void InsertCocktail(Cocktail instance);
예제 #7
0
 public EditWindow(Cocktail cocktail)
 {
     InitializeComponent();
     this.cocktail = cocktail;
     editMode      = true;
 }