コード例 #1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var drank = new Dranken();

            drank.NAAM  = txtNaam.Text;
            drank.SOORT = txtSoort.Text;
            drank.PRIJS = txtPrijs.Text;
            db.Drankens.InsertOnSubmit(drank);
            db.SubmitChanges();

            dgDranken.ItemsSource = db.Drankens.ToList();
        }
コード例 #2
0
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     {
         DataClasses1DataContext dr = new DataClasses1DataContext();
         Dranken DrDelete           = dgDranken.SelectedItem as Dranken;
         var     drankie            = (from Dranken in dr.Drankens
                                       where Dranken.ID == DrDelete.ID
                                       select Dranken).Single();
         dr.Drankens.DeleteOnSubmit(drankie);
         dr.SubmitChanges();
         dgDranken.ItemsSource = db.Drankens.ToList();
     }
 }
コード例 #3
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            {
                DataClasses1DataContext dr = new DataClasses1DataContext();
                Dranken DrDelete           = dgDrank.SelectedItem as Dranken;
                var     drankie            = (from Dranken in dr.Drankens
                                              where Dranken.ID == DrDelete.ID
                                              select Dranken).Single();
                dr.Drankens.DeleteOnSubmit(drankie);
                dr.SubmitChanges();
                dgDrank.ItemsSource = db.Drankens.ToList();

                string ID   = txtID.Text;
                var    show = db.Drankens.Where(p => Convert.ToString(p.ID).Contains(ID));
                dgDrank.ItemsSource = show;
            }
        }
コード例 #4
0
 partial void DeleteDranken(Dranken instance);
コード例 #5
0
 partial void UpdateDranken(Dranken instance);
コード例 #6
0
 partial void InsertDranken(Dranken instance);