Пример #1
0
        private void UpdateOrderView()
        {
            try
            {
                DataParser cp = new DataParser(ci);
                OrderView.Items.Clear();
                Decimal totalPrice = 0;
                for (int i = 0; i < currentOrder.Items.Count; i++)
                {
                    ListViewItem lvi = new ListViewItem(cp.parseItem(currentOrder.Items.ElementAt(i).Name));
                    totalPrice += (Decimal)currentOrder.Items.ElementAt(i).Price;
                    lvi.Tag     = i; // Set to the index of the order item
                    OrderView.Items.Add(lvi);
                    if (currentOrder.Items.ElementAt(i).Components.Count > 0)
                    {
                        foreach (NSAComponent c in currentOrder.Items.ElementAt(i).Components)
                        {
                            ListViewItem changeItem = new ListViewItem(""); // Set to blank so we can see the change
                            changeItem.SubItems.Add(cp.parseItem(c.ToString()));
                            changeItem.Tag = i;
                            OrderView.Items.Add(changeItem);
                        }
                    }
                }

                OrderView.Items.Add(new ListViewItem("Total: " + totalPrice.ToString("C")));
            }
            catch (System.NullReferenceException e) {
                Console.WriteLine(e.StackTrace);
            }
        }
Пример #2
0
        public void populateComponents()
        {
            DataParser dataParser = new DataParser(ci);

            BreadPanel.Visible = customizeItem.BreadIndex >= 0;

            foreach (NSAComponent comp in customizeComponents)
            {
                if (comp.Category != "Bread")
                {
                    OtherListBox.Items.Add(comp, customizeItem.Components.Contains(comp));
                }
                else
                {
                    ListViewItem nlvi = new ListViewItem(dataParser.parseItem(comp.Name));
                    nlvi.Tag = comp;
                    BreadList.Items.Add(nlvi);
                }
            }
        }
Пример #3
0
        private void updateMenu()
        {
            DataParser dataParser = new DataParser(ci); //parses Categories, Menu Items, and Components and displays them in the users language

            foreach (NSAMenuCategory category in menu)
            {
                //Do not Display "unassigned" category
                if (category.Id == 0)
                {
                    continue;
                }
                ListViewGroup LVG = new ListViewGroup(dataParser.parseCategory(category.Name));
                foreach (NSAMenuItem item in category.Items)
                {
                    if (item.CategoryID != category.Id)
                    {
                        continue;
                    }
                    ListViewItem newitem = new ListViewItem(dataParser.parseItem(item.Name), item.Image, LVG);
                    newitem.Tag = item;
                    menuListView.Items.Add(newitem);
                }
                menuListView.Groups.Add(LVG);
            }

            ListViewGroup RandomGroup   = new ListViewGroup(dataParser.parseCategory("Random"));
            ListViewItem  randomItemLVI = new ListViewItem("Random Sandwich!", RandomGroup);
            NSARandomItem randomItem    = new NSARandomItem();

            randomItem.CategoryID = 1;
            randomItem.Price      = 9.99;
            randomItem.MenuType   = "Random!";
            randomItem.Name       = "Random";
            randomItemLVI.Tag     = randomItem;
            menuListView.Items.Add(randomItemLVI);
            menuListView.Groups.Add(RandomGroup);

            rm.GetString("accountNumber", ci);
            rm.GetString("accountNumber", ci);
        }