示例#1
0
        // для создания/редактирования товара создаем окно
        private void CreateProductButton_Click(object sender, RoutedEventArgs e)
        {
            var NewProduct = new ProductWindow(new Products());

            if ((bool)NewProduct.ShowDialog())
            {
                MyProducts = Core.DB.vw_ProductDetails.ToList();
            }
        }
示例#2
0
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            var item        = MainDataGrid.SelectedItem as vw_ProductDetails;
            var EditProduct = Core.DB.Products.Find(item.Id);

            if (EditProduct != null)
            {
                var NewProduct = new ProductWindow(EditProduct);
                if ((bool)NewProduct.ShowDialog())
                {
                    MyProducts = Core.DB.vw_ProductDetails.ToList();
                }
            }
        }