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(); } }
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); } }
public void CreateNewProduct() { this.product = new Product(); }
//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); }