public void ChangeProduct(Action action) { var checkMenu = true; while (checkMenu) { Console.Clear(); BaseConsoleFunction.WithdrawList(_changeMenuItems); BaseConsoleFunction.ConsoleDelimiter(); BaseConsoleFunction.WithdrawList(_manufacturerService.Manufacturer.Foods.ToArray()); var checkItem = Checker.GetPropertyInt(Console.ReadLine()); switch (checkItem) { case 1: CheckProduct(action); break; case 2: checkMenu = false; break; default: Console.WriteLine("Incorrect data"); Console.ReadLine(); break; } } }
public async Task CreateNewOrder() { Console.Clear(); if (SelectManufacturer()) { var continueCheck = true; while (continueCheck) { Console.Clear(); await ShowOrderPrice(); BaseConsoleFunction.ConsoleDelimiter(); BaseConsoleFunction.WithdrawList(_orderMenuItems); BaseConsoleFunction.ConsoleDelimiter(); ShowMenu(); var checkItem = Checker.GetPropertyInt(Console.ReadLine()); switch (checkItem) { case 1: AddProduct(); break; case 2: CreateOrder(); break; case 3: continueCheck = false; break; default: Console.WriteLine("Incorrect data"); break; } } } }