Exemplo n.º 1
0
        private void MenuItem_MouseDown(object sender, RoutedEventArgs e)
        {
            //provmenu.PlacementTarget = this;
            //provmenu.IsOpen = true;

            ProductsSet p = new ProductsSet();

            p.Enbusca = false.ToString();
            p.Enventa = true.ToString();
            if (ProvedorID != null && ProvedorID != "")
            {
                p.Proveedor_ID = ProvedorID;
            }
            Machine productdetails = new Machine(p);

            productdetails._new = true;

            productdetails.ShowDialog();

            if (productdetails._new && !productdetails.Cancel)
            {
                lp.Add(p);
                _dataDC.ProductsSet.AddObject(p);
                _dataDC.SaveChanges();
                filter();
                checkNotifications(p);
            }
        }
Exemplo n.º 2
0
        private void MenuItem_MouseDown(object sender, RoutedEventArgs e)
        {
            //provmenu.PlacementTarget = this;
            //provmenu.IsOpen = true;

            ProductsSet p = new ProductsSet();

            p.Enbusca = false.ToString();
            p.Enventa = true.ToString();
            Machine productdetails = new Machine(p);

            productdetails._new = true;

            productdetails.ShowDialog();

            if (productdetails._new)
            {
                lp.Add(p);
                _dataDC.ProductsSet.AddObject(p);
                _dataDC.SaveChanges();
            }
            _dataDC.Dispose();
        }