private void Win_Main_KeyDown(object sender, KeyEventArgs e) { Window actWnd = Application.Current.Windows.OfType <Window>().SingleOrDefault(x => x.IsActive); //var window = Window.GetWindow(this); if (this == actWnd) { if (e.Key == Key.Return) { producten product = (from producten in db.productens where (producten.barcode == sBarcode) select producten).FirstOrDefault(); if (product != null) { Artikel_Aantal_Ophogen(product.id, Bestelling_Id); } else { MessageBox.Show("Onbekende barcode!"); } sBarcode = ""; e.Handled = true; } else { if (e.Key >= Key.D0 && e.Key <= Key.D9) { var strKey = new KeyConverter().ConvertToString(e.Key); sBarcode = sBarcode + strKey; e.Handled = true; } } } }
partial void Deleteproducten(producten instance);
partial void Updateproducten(producten instance);
partial void Insertproducten(producten instance);
private void detach_productens(producten entity) { this.SendPropertyChanging(); entity.product_soorten = null; }