private void btnViewProducts_Click(object sender, RoutedEventArgs e) { Products productCtrl = new Products(false); PopupWindow productDialog = new PopupWindow("All products"); productDialog.Width = 1100; productDialog.Height = 800; productDialog.AddControl(productCtrl); productDialog.ShowDialog(); // grdProduct.RefreshData(); }
private void btnSetCapacity_Click(object sender, RoutedEventArgs e) { CustomerCapacities capacityControl = new CustomerCapacities(); PopupWindow resetCapacityDialog = new PopupWindow("Set Capacity"); resetCapacityDialog.AddControl(capacityControl); resetCapacityDialog.ShowDialog(); }
private void btnCreateProduct_Click(object sender, RoutedEventArgs e) { CreateNewProduct createProductCtrl = new CreateNewProduct(); PopupWindow createProductDialog = new PopupWindow("Creating New Product"); createProductCtrl.Close += new EventHandler(createProductDialog.CloseWindowEvent); createProductDialog.Width = 400; createProductDialog.Height = 300; createProductDialog.AddControl(createProductCtrl); createProductDialog.ShowDialog(); }
private void btnAddBrandAxes_Click(object sender, RoutedEventArgs e) { BrandAxes brandAxes = new BrandAxes(); PopupWindow addBrandAxeDialog = new PopupWindow("Add new Brand/Axe"); addBrandAxeDialog.AddControl(brandAxes); addBrandAxeDialog.ShowDialog(); // update grdBrandAxe DataSource BrandAxeData = new ObservableCollection<BrandAxe>(BrandAxeManager.Instance.GetAll()); grdBrandAxes.DataContext = BrandAxeData; grdBrandAxes.RefreshData(); // remove sales, which have a reference to one of deleted brandaxes retailSalesToAdd.RemoveAll(s=> BrandAxeData.Where(b=>b.ID == s.IDBrandAxe).Count() == 0); grdRetailSales.RefreshData(); }