예제 #1
0
        public AddProduct()
        {
            InitializeComponent();
            productControl = new ProductControl();

            BrandCombo.ItemsSource    = productControl.GetAllBrands();
            CategoryCombo.ItemsSource = productControl.GetAllCategories();

            Product product = new Product()
            {
                Name          = null,
                Price         = 0.0m,
                Description   = null,
                AmountOnStock = 0
            };

            Brand brand = new Brand()
            {
                Name = null
            };

            Category category = new Category()
            {
                Name = null
            };

            this.DataContext = new
            {
                Product  = product,
                Brand    = brand,
                Category = category
            };
        }
        public UpdateProductGUI()
        {
            InitializeComponent();

            pctr                      = new ProductControl();
            brands                    = (List <Brand>)pctr.GetAllBrands();
            categories                = (List <Category>)pctr.GetAllCategories();
            BrandCombo.ItemsSource    = brands;
            CategoryCombo.ItemsSource = categories;

            listProducts.ItemsSource = pctr.GetAllProducts();
        }