Ejemplo n.º 1
0
        // Initialize state of all UI componets
        public void InitializeUI()
        {
            InitializeMenu();

            // Unset category
            categoriesComboBox.SelectedItem = -1;

            // Intialize book table
            BookCatalog bookCat = new BookCatalog();

            DsBookCat = bookCat.GetBookInfo();
            Console.WriteLine(DsBookCat.ToString());

            this.DataContext = DsBookCat.Tables["Category"];

            // Intialize book order context (resets order table)
            bookOrder = new BookOrder();
            this.listViewOrders.ItemsSource = bookOrder.OrderItemList;

            // Intialize status bar message
            this.textBlockStatus.Text = "Please login before proceeding to checkout.";

            // Close any windows or dialogs
            if (UserProfile != null)
            {
                UserProfile.Close();
                UserProfile = null;
            }
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BookCatalog bookCat = new BookCatalog();

            dsBookCat = bookCat.GetBookInfo();
            //this.DataContext = dsBookCat.Tables["Category"];
            bookOrder = new BookOrder();
            userData  = new UserData();
            // this.orderListView.ItemsSource = bookOrder.OrderItemList;
        }
Ejemplo n.º 3
0
        public Recommendations(int Uid)
        {
            InitializeComponent();
            UserId = Uid;
            BookCatalog bookCat   = new BookCatalog();
            DataSet     dsBookCat = bookCat.GetBookInfo();

            this.DataContext = dsBookCat.Tables["Category"];

            //RecomendationDataGrid.Items.Refresh();
        }
Ejemplo n.º 4
0
        public Store(UserData u)
        {
            InitializeComponent();
            this.user   = u;
            bookCatalog = new BookCatalog();
            bookCart    = new BookCart();

            dsBookCat        = bookCatalog.GetBookInfo();
            this.DataContext = dsBookCat.Tables["Category"];
            cart_val.Text    = "" + bookCart.cartItems(user.UserID);
        }
Ejemplo n.º 5
0
 private void searchTxb_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (searchTxb.Text == "")
     {
         dsBookCat        = bookCatalog.GetBookInfo();
         this.DataContext = dsBookCat.Tables["Category"];
     }
     else
     {
         dsBookCat        = bookCatalog.SearchBook(searchTxb.Text);
         this.DataContext = dsBookCat.Tables["Category"];
     }
 }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BookCatalog bookCat = new BookCatalog();

            dsBookCat = bookCat.GetBookInfo();
            //this.DataContext = dsBookCat.Tables["Category"];
            bookOrder = new BookOrder();
            userData  = new UserData();

            if (!userData.LoggedIn)
            {
                this.statusTextBlock.Text = "You are currently browsing as a Guest. Please log in.";
            }
            // this.orderListView.ItemsSource = bookOrder.OrderItemList;
        }