private static void DisplayMenu() { Console.Clear(); HappyConsole.WriteDarkYellowLine("=== Menu:"); HappyConsole.WriteDarkYellowLine("= 1 - GetProductBasePrices()"); HappyConsole.WriteDarkYellowLine("= 2 - GetProductBasePricesRx()"); HappyConsole.WriteDarkYellowLine("= 5 - Clear terminal"); HappyConsole.WriteDarkYellowLine("== Esc - Exit"); }
private static Task GetProductBasePricesRx() { var productService = new ProductPriceService(); var stoperRx = new Stoper(); productService .GetProductBasePricesRx() .Subscribe( x => HappyConsole.WriteCyanLine($"{x.ProductId,2} - {x.Price,5} - {x.IsActive}"), () => stoperRx.Dispose()); return(Task.CompletedTask); }
private static async Task GetProductBasePrice() { var productService = new ProductPriceService(); using (var stoper = new Stoper()) { var productPrices = await productService.GetProductBasePrices(); foreach (var item in productPrices) { HappyConsole.WriteBlueLine($"{item.ProductId,2} - {item.Price,5} - {item.IsActive}"); } } }
private static void DisplayProduct(Product item) { HappyConsole.WriteBlueLine($"{item.ProductId,2} - {item.Price,5} - {item.IsActive}"); }
private static void DisplayCustomerPricesHeader() { HappyConsole.WriteDarkGreenLine("CustomerId == ProductId == Price == Active"); HappyConsole.WriteDarkGreenLine("=========================================="); }
private static void DisplaySingleCustomerPrice(CustomerPrice customerPrice) { HappyConsole.WriteGreenLine($"{customerPrice.CustomerId,2} {customerPrice.ProductId,13} {customerPrice.Price.ToString("C2"),17} {(customerPrice.IsActive ? "A" : ""),3}"); }
private static void DisplayCustomerPricesFooter() { HappyConsole.WriteDarkGreenLine("=========================================="); }