示例#1
0
文件: GUI.cs 项目: wytsevisser/wvt
        public void RefreshList(Cart cart)
        {
            ClearList();
            foreach(KeyValuePair<Product, int> p in cart.products)
            {
                string quantity = cart.getActualQuantityForProduct(p.Key) +
                                    "/" +
                                    cart.getRequiredQuantityForProduct(p.Key);

                string name = p.Key.Name;
                string price = String.Format(culture, "{0:c}", p.Key.Price);

                string[] product = new string[] { quantity, name, price };

                ListViewItem item = new ListViewItem(product);
                listView.Items.Add(item);
            }
            menuItemRight.Text = String.Format(culture, "{0:c}", cart.getTotalPrice());
        }