public static void WalkAround() { PrintHeader(); Console.WriteLine("¿Que deseas comprar?\n\n"); for (int i = 0; i < market.Count(); i++) { PrintProduct(i, market[i]); } while (true) { try { int answer = Convert.ToInt32(Console.ReadLine()); if (answer >= market.Count()) { continue; } AddToCart(market[answer]); productodelasagna pro = new productodelasagna(chekiar); pro(market[answer]); break; } catch { continue; } } }
static void Main(string[] args) { cart = new List <Product>(); market = new List <Product>(); lasagna = new List <Product>(); chekiando += new productodelasagna(chekiar); SupplyStore(); while (true) { PrintHeader(); Console.WriteLine("¿Que quieres hacer?\n"); Console.WriteLine("\t1. Ver Receta"); Console.WriteLine("\t2. Comprar"); Console.WriteLine("\t3. Ver carrito"); Console.WriteLine("\t4. Pagar"); Console.WriteLine("\t5. Salir"); while (true) { String answer = Console.ReadLine(); if (answer == "1") { ShowRecipe(); break; } else if (answer == "2") { WalkAround(); break; } else if (answer == "3") { PrintCart(); break; } else if (answer == "4") { Pay(); break; } else if (answer == "5") { Environment.Exit(1); } } } }