public CustomerWindow(Boolean logIn, String userEmail) { InitializeComponent(); UniversalFunctions.setUpWindow(this); this.isUserSignedIn = false; DataGridProducts.DataContext = ServiceProducts.getProductsToDisplay().DefaultView; btnShowProducts.Visibility = Visibility.Hidden; btnShowCart.IsEnabled = isUserSignedIn; btnOrderHistory.IsEnabled = isUserSignedIn; this.isUserSignedIn = logIn; currentUserEmail = userEmail; if (this.isUserSignedIn) { btnCustomerLogInMenu.Visibility = Visibility.Hidden; lblSingedInAs.Content = "Signed in as " + ServiceCustomer.getNameFromEmail(userEmail); btnShowCart.IsEnabled = isUserSignedIn; btnOrderHistory.IsEnabled = isUserSignedIn; } else { lblSingedInAs.Content = "Login Failed"; } }
private void btnShowProducts_Click(object sender, RoutedEventArgs e) { dgOrderHistory.Visibility = Visibility.Hidden; DataGridProducts.Visibility = Visibility.Visible; DataGridProducts.DataContext = ServiceProducts.getProductsToDisplay().DefaultView; btnShowCart.Visibility = Visibility.Visible; btnConfirmOrder.Visibility = Visibility.Hidden; btnShowProducts.Visibility = Visibility.Hidden; }
public CustomerWindow() { InitializeComponent(); UniversalFunctions.setUpWindow(this); this.isUserSignedIn = false; btnShowProducts.Visibility = Visibility.Hidden; btnShowCart.IsEnabled = isUserSignedIn; btnOrderHistory.IsEnabled = isUserSignedIn; DataGridProducts.DataContext = ServiceProducts.getProductsToDisplay().DefaultView; }