private void btnPinvoer_Click(object sender, RoutedEventArgs e)
        {
            DateTime nu = new DateTime();
            product  p  = new product();

            p.name        = txtProductnaam.Text;
            p.producttype = (producttype)cbType.SelectedItem;
            pricehistory ph = new pricehistory();

            int prijs;

            int.TryParse(txtPrijs.Text, out prijs);

            ph.price     = prijs;
            ph.startdate = DateTime.Now.Date;

            ph.product = p;
            db.products.InsertOnSubmit(p);
            db.pricehistories.InsertOnSubmit(ph);
            db.SubmitChanges();

            dgProducten.ItemsSource = db.products;
            Producteninvoer pi = new Producteninvoer();

            pi.Show();
            this.Close();

            MessageBox.Show("Het product " + " " + txtProductnaam.Text + " " + "is toegevoegd aan de database", "Gelukt!");
        }
Ejemplo n.º 2
0
 private void detach_pricehistories(pricehistory entity)
 {
     this.SendPropertyChanging();
     entity.product = null;
 }
Ejemplo n.º 3
0
 partial void Deletepricehistory(pricehistory instance);
Ejemplo n.º 4
0
 partial void Updatepricehistory(pricehistory instance);
Ejemplo n.º 5
0
 partial void Insertpricehistory(pricehistory instance);