コード例 #1
0
        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";
            }
        }
コード例 #2
0
 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;
 }
コード例 #3
0
        public CustomerWindow()
        {
            InitializeComponent();

            UniversalFunctions.setUpWindow(this);

            this.isUserSignedIn = false;

            btnShowProducts.Visibility   = Visibility.Hidden;
            btnShowCart.IsEnabled        = isUserSignedIn;
            btnOrderHistory.IsEnabled    = isUserSignedIn;
            DataGridProducts.DataContext = ServiceProducts.getProductsToDisplay().DefaultView;
        }