示例#1
0
        public static void DrawConsole(int width, int height)
        {
            Console.SetWindowSize(width, height);
            Product testEventProduct = new Product();
            Ads testEventAds = new Ads();

            while (!isFinished)
            {
                testEventProduct.Promotion += Product_OnPromotionTypeChanged;
                testEventProduct.CheckForPromotion(StockRoom.ProductList());
                DrawBorders(width, height);

                Console.WriteLine(" ****** !!! Advertisements !!! ******");
                testEventAds.AdsEH += Ads_AdsTypeChanged;
                testEventAds.CheckForActiveAds(AdsStock.GetAllAds());
                Console.WriteLine(" ****** !!! Advertisements !!! ******");
                DrawBorders(width, height);

                Console.WriteLine("   You are browsing as {0}", 
                    currentCustomer == null ? "nobody! Register or login." : currentCustomer.Name + ".");
                DrawBorders(width, height);

                DrawMenu(width);
                int choice = DrawSubMenu();
                ShowChoice(choice);

                AskToContinue(); //Gives time to user can read message

                Console.Clear();
            }
        }
示例#2
0
 protected void OnPromotionTypeChanged(Product product)
 {
     if (Promotion != null)
     {
         Console.WriteLine("Product {0} is in promotion: {1}", product.name, product.isPromotion);
         InPromotionEventArgs args = new InPromotionEventArgs(product.name);
         Promotion(this, args);
     }
 }
示例#3
0
 public void CreateNewProduct()
 {
     this.product = new Product();
 }
示例#4
0
        //New client categories: Individual client and Corporate client

        #endregion

        #region METHODS

        //Add product in basket
        public void AddProduct(Product product, int count)
        {
            this.currentClientBasket.Add(product, count);
        }