コード例 #1
0
        public Checkout_Categorised(Database Database, string Category)
        {
            OldDB           = Database;
            DB              = Database;
            CurrentCheckout = DB.GetCurrentCheckout();
            InitializeComponent();
            Label.Content = Category;

            if (Category == "Custom Orders")
            {
                List <CustomOrder> CustomOrders = new List <CustomOrder>();
                foreach (CustomOrder custOrder in DB.GetListOfCustomOrders())
                {
                    if (!custOrder.getIsPaid() && custOrder.getActiveOrder())
                    {
                        CustomOrders.Add(custOrder);
                    }
                }
                listBoxItems.ItemsSource = CustomOrders;
            }
            else
            {
                List <Product> RawProducts = DB.GetListOfProducts();
                List <Product> Products    = new List <Product>();
                foreach (Product Product in RawProducts)
                {
                    if (Product.GetItemType() == Category)
                    {
                        Products.Add(Product);
                    }
                }
                listBoxItems.ItemsSource = Products;
            }

            listBoxCheckout.ItemsSource = CurrentCheckout.GetCollection();
            UpdateTotal();
        }
コード例 #2
0
ファイル: Database.cs プロジェクト: Fewster/WPF_CashierSystem
 public void ClearCheckout()
 {
     currentTransaction = new Checkout();
 }