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;
                    }
                }
            }
        }
Exemple #2
0
 partial void Deleteproducten(producten instance);
Exemple #3
0
 partial void Updateproducten(producten instance);
Exemple #4
0
 partial void Insertproducten(producten instance);
Exemple #5
0
 private void detach_productens(producten entity)
 {
     this.SendPropertyChanging();
     entity.product_soorten = null;
 }