private void btnChooseProduct_Click(object sender, RoutedEventArgs e) { ProductRegister productRegister = new ProductRegister(true, DepartmentID); if (productRegister.ShowDialog() == true) { if (SelectedProducts.Contains(productRegister.SelectedProduct)) { MessageBox.Show("Du kan inte välja samma produkt flera gånger"); } else { SelectedProducts.Add(productRegister.SelectedProduct); CreateColumn(productRegister.SelectedProduct); } } }
/// <summary> /// Loads CustomerRegister and clear the temporary list TempIncomeList /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnChoseProduct_Click(object sender, RoutedEventArgs e) { ProductRegister productRegister = new ProductRegister(true); if (productRegister.ShowDialog() == true) { SelectedProduct = productRegister.SelectedProduct; FinancialIncomeList = new ObservableCollection <FinancialIncome>(RevenueManagement.Instance.GetFinancialIncomesByProduct(SelectedProduct.ProductID)); dgIncomeCustomer.ItemsSource = FinancialIncomeList; lblProductID.Content = SelectedProduct.ProductID; lblProductName.Content = SelectedProduct.ProductName; dgIncomeCustomer.IsEnabled = true; LockPrimaryCells(); if (CurrentFinancialIncomeYear.FinancialIncomeLock == false) { btnDelete.IsEnabled = true; btnSave.IsEnabled = true; } UpdateLabels(); } }
private void btnProdukthantering_Click(object sender, RoutedEventArgs e) { ProductRegister productRegister = new ProductRegister(); productRegister.ShowDialog(); }