Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            stack1.Children.Add(search);

            Navigation.ContentContainer = stack1;
            Navigation.BackButton = backButton;

            // Items
            itemsList = new Items[22];
            Items apple = new Items("Apple", "Produce", true, 0.99, 0, 103, 67, 93, 43);
            itemsList[0] = apple;
            Items banana = new Items("Banana", "Produce", true, 0.99, 0, 237, 128, 177, 85);
            itemsList[1] = banana;
            Items rice = new Items("Rice", "Aisle 1", true, 11.99, 0, 61, 95, 109, 382);
            itemsList[2] = rice;
            Items salsa = new Items("Salsa", "Aisle 1", true, 6.99, 4.99, 216, 141, 187, 401);
            itemsList[3] = salsa;
            Items vinegar = new Items("Vinegar", "Aisle 2", true, 5.99, 0, 71, 142, 100, 366);
            itemsList[4] = vinegar;
            Items oliveOil = new Items("Olive Oil", "Aisle 2", true, 8.99, 0, 93, 142, 118, 366);
            itemsList[5] = oliveOil;
            Items tomatoSauce = new Items("Tomato Sauce", "Aisle 3", true, 3.99, 0, 223, 98, 176, 284);
            itemsList[6] = tomatoSauce;
            Items kethcup = new Items("Ketchup", "Aisle 3", true, 5.99, 0, 175, 140, 158, 327);
            itemsList[7] = kethcup;
            Items chickenSoup = new Items("Chicken Soup", "Aisle 4", true, 1.99, 0, 269, 141, 193, 269);
            itemsList[8] = chickenSoup;
            Items goldFishCrackers = new Items("Gold Fish Crackers", "Aisle 4", true, 4.99, 0, 88, 98, 111, 246);
            itemsList[9] = goldFishCrackers;
            Items flour = new Items("Flour", "Aisle 5", true, 12.99, 0, 253, 141, 184, 229);
            itemsList[10] = flour;
            Items cannedFruit = new Items("Canned Fruit", "Aisle 5", true, 5.99, 0, 32, 140, 81, 229);
            itemsList[11] = cannedFruit;
            Items cheerios = new Items("Cheerios", "Aisle 6", false, 8.99, 5.49, 192, 140, 153, 190);
            itemsList[12] = cheerios;
            Items orangeJuice = new Items("Orange Juice", "Aisle 6", true, 7.99, 0, 132, 101, 121, 171);
            itemsList[13] = orangeJuice;
            Items activiaYogurt = new Items("Activia Yogurt", "Dairy", false, 5.99, 2.59, 166, 170, 48, 280);
            itemsList[14] = activiaYogurt;
            Items milk = new Items("Milk", "Dairy", true, 6.29, 0, 166, 64, 48, 190);
            itemsList[15] = milk;
            Items bread = new Items("Bread", "Bakery", true, 9.99, 0, 101, 136, 98, 476);
            itemsList[16] = bread;
            Items muffins = new Items("Muffins", "Bakery", true, 6.99, 0, 198, 101, 172, 453);
            itemsList[17] = muffins;
            Items chickenBreast = new Items("Chicken Breast", "Meat", true, 11.99, 0, 149, 175, 42, 458);
            itemsList[18] = chickenBreast;
            Items frozenShrimp = new Items("Frozen Shrimp", "Meat", true, 14.99, 11.99, 172, 212, 56, 477);
            itemsList[19] = frozenShrimp;
            Items halfDozenEggs = new Items("Half Dozen Eggs", "Dairy", true, 1.99, 0, 166, 150, 48, 240);
            itemsList[20] = halfDozenEggs;
            Items dozenEggs = new Items("Dozen Eggs", "Dairy", true, 2.99, 0, 166, 151, 48, 241);
            itemsList[21] = dozenEggs;

            sales = new Sales(itemsList);
            search.itemsList = itemsList;
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            stack1.Children.Add(search);

            Navigation.ContentContainer = stack1;
            Navigation.BackButton = backButton;

            // Items
            itemsList = new Items[20];
            Items apple = new Items("Apple", "Produce", true, 0.99, 0, 61, 110, 1, 1);
            itemsList[0] = apple;
            Items banana = new Items("Banana", "Produce", true, 0.99, 0, 216, 141, 1, 1);
            itemsList[1] = banana;
            Items rice = new Items("Rice", "Aisle 1", true, 11.99, 0, 61, 110, 99, 393);
            itemsList[2] = rice;
            Items salsa = new Items("Salsa", "Aisle 1", true, 6.99, 4.99, 216, 141, 189, 409);
            itemsList[3] = salsa;
            Items vinegar = new Items("Vinegar", "Aisle 2", true, 5.99, 0, 71, 142, 100, 374);
            itemsList[4] = vinegar;
            Items oliveOil = new Items("Olive Oil", "Aisle 2", true, 8.99, 0, 93, 142, 112, 374);
            itemsList[5] = oliveOil;
            Items tomatoSauce = new Items("Tomato Sauce", "Aisle 3", true, 3.99, 0, 223, 98, 176, 292);
            itemsList[6] = tomatoSauce;
            Items kethcup = new Items("Ketchup", "Aisle 3", true, 5.99, 0, 175, 140, 158, 338);
            itemsList[7] = kethcup;
            Items chickenSoup = new Items("Chicken Soup", "Aisle 4", true, 1.99, 0, 269, 141, 193, 274);
            itemsList[8] = chickenSoup;
            Items goldFishCrackers = new Items("Gold Fish Crackers", "Aisle 4", true, 4.99, 0, 88, 98, 111, 225);
            itemsList[9] = goldFishCrackers;
            Items flour = new Items("Flour", "Aisle 5", true, 12.99, 0, 253, 141, 184, 237);
            itemsList[10] = flour;
            Items cannedFruit = new Items("Canned Fruit", "Aisle 5", true, 5.99, 0, 32, 140, 81, 237);
            itemsList[11] = cannedFruit;
            Items cheerios = new Items("Cheerios", "Aisle 6", false, 8.99, 5.49, 192, 140, 153, 197);
            itemsList[12] = cheerios;
            Items orangeJuice = new Items("Orange Juice", "Aisle 6", true, 7.99, 0, 115, 140, 125, 182);
            itemsList[13] = orangeJuice;
            Items activiaYogurt = new Items("Activia Yogurt", "Dairy", false, 5.99, 3.00, 1, 1, 1, 1);
            itemsList[14] = activiaYogurt;
            Items milk = new Items("Milk", "Dairy", true, 6.29, 0, 1, 1, 1, 1);
            itemsList[15] = milk;
            Items bread = new Items("Bread", "Bakery", true, 9.99, 0, 1, 1, 1, 1);
            itemsList[16] = bread;
            Items muffins = new Items("Muffins", "Bakery", true, 6.99, 0, 1, 1, 1, 1);
            itemsList[17] = muffins;
            Items chickenBreast = new Items("Chicken Breast", "Meat", true, 11.99, 0, 1, 1, 1, 1);
            itemsList[18] = chickenBreast;
            Items frozenShrimp = new Items("Frozen Shrimp", "Meat", true, 14.99, 11.99, 1, 1, 1, 1);
            itemsList[19] = frozenShrimp;

            sales = new Sales(itemsList);
            search.itemsList = itemsList;
        }
Exemplo n.º 3
0
        public Results_Map(Items product)
        {
            InitializeComponent();

            Product_Name.Text = product.name;
            AisleNum.Text = product.location;
            int xMiniLoc = product.xMiniLoc;
            int yMiniLoc = product.yMiniLoc;

            Product_Stock.Text = product.getAvailability;

            if (product.salePrice != 0)
            {
                Product_OldPrice.Text = product.oldPrice.ToString();
                Product_SalePrice.Text = product.salePrice.ToString();
            }
            else
            {
                Product_Price.Text = product.price.ToString();
            }

            Product_IMG.Source = product.bi;
            Target.Margin = new Thickness(xMiniLoc, yMiniLoc, 0, 0);
        }
Exemplo n.º 4
0
 public Sales(Items[] list)
 {
     InitializeComponent();
     itemsList = list;
 }
Exemplo n.º 5
0
        public Results_Map(Items product)
        {
            InitializeComponent();
            if (product != null)
            {
                item = product;
                Product_Name.Text = product.name;
                AisleNum.Text = product.location;
                int xMiniLoc = product.xMiniLoc;
                int yMiniLoc = product.yMiniLoc;

                Product_Stock.Text = product.getAvailability;

                if (product.salePrice != 0)
                {
                    Product_Price.Visibility = Visibility.Collapsed;
                    Product_OldPrice.Text = product.oldPrice.ToString();
                    Product_SalePrice.Text = product.salePrice.ToString();
                    Product_SalePrice.Margin = new Thickness(5, 45, 0, 0);
                    Product_Stock.Margin = new Thickness(5, 60, 0, 0);
                }
                else
                {
                    Product_Price.Text = product.price.ToString();
                }

                Product_IMG.Source = product.bi;
                Target.Margin = new Thickness(xMiniLoc, yMiniLoc, 0, 0);

                /// <summary>
                ///  the following ifs Adjust map images and hide labels appropriately
                /// </summary>
                if (!product.location.ToLower().Contains("aisle")) /// if not contain aisle
                {
                    topAisle.Visibility = System.Windows.Visibility.Hidden;
                    midAisle.Visibility = System.Windows.Visibility.Hidden;
                    bottomAisle.Visibility = System.Windows.Visibility.Hidden;

                    if (product.location.ToLower().Contains("bakery"))
                    {
                        MiniMap.Source = new BitmapImage(new Uri(@"\images\store\Bakery.png", UriKind.Relative));
                    }

                    else if (product.location.ToLower().Contains("meat"))
                    {
                        MiniMap.Source = new BitmapImage(new Uri(@"\images\store\Meats.png", UriKind.Relative));
                    }

                    else if (product.location.ToLower().Contains("dairy"))
                    {
                        MiniMap.Source = new BitmapImage(new Uri(@"\images\store\Dairy.png", UriKind.Relative));
                    }

                    else if (product.location.ToLower().Contains("produce"))
                    {
                        MiniMap.Source = new BitmapImage(new Uri(@"\images\store\Produce.png", UriKind.Relative));
                    }

                    else if (product.location.ToLower().Contains("spindle"))
                    {
                        MiniMap.Source = new BitmapImage(new Uri(@"\images\store\spindles.png", UriKind.Relative));
                    }
                }
                /// <summary>
                ///  the following adjust the numbers in the labels.
                /// </summary>
                else /// We know it's in aisle because of previous if statement.
                {
                    if (product.location.ToLower().Contains("1"))
                    {
                        bottomAisle.Content = "▼Bakery▼";
                        midAisle.Content = "1";
                        topAisle.Content = "2";
                        bottomAisle.Foreground = System.Windows.Media.Brushes.SaddleBrown;
                    }

                    else if (product.location.ToLower().Contains("2"))
                    {
                        bottomAisle.Content = "1";
                        midAisle.Content = "2";
                        topAisle.Content = "3";
                    }

                    else if (product.location.ToLower().Contains("3"))
                    {
                        bottomAisle.Content = "2";
                        midAisle.Content = "3";
                        topAisle.Content = "4";
                    }

                    else if (product.location.ToLower().Contains("4"))
                    {
                        bottomAisle.Content = "3";
                        midAisle.Content = "4";
                        topAisle.Content = "5";
                    }

                    else if (product.location.ToLower().Contains("5"))
                    {
                        bottomAisle.Content = "4";
                        midAisle.Content = "5";
                        topAisle.Content = "6";
                    }
                    else if (product.location.ToLower().Contains("6"))
                    {
                        bottomAisle.Content = "5";
                        midAisle.Content = "6";
                        topAisle.Content = "▲PRODUCE▲";
                        topAisle.Foreground = System.Windows.Media.Brushes.ForestGreen;
                    }
                }
            }
            else
            {
                ItemGrid.Visibility = Visibility.Collapsed;
                MapGrid.Visibility = Visibility.Collapsed;
                fullMapButton.Visibility = Visibility.Collapsed;
                mapLabel.Visibility = Visibility.Collapsed;

                errorLabel.Visibility = Visibility.Visible;

            }
        }