public void productList() { try { ProductDataBase.Products.ForEach(x => Console.WriteLine(x.ToString())); if (ProductDataBase.Products.Count() <= 0) { Console.WriteLine("Product List Is Empty ..!\nLogin as Manager to Add Some Product"); userRecords = new UserRecords(); userRecords.Login(); } } catch (Exception) { Console.WriteLine("Error"); } this.AddProductToCart(); Console.WriteLine("\nY to ADD more Product or N to Exit"); string yesORno = Console.ReadLine().ToLower(); if (yesORno == "y") { this.productList(); } else { Console.WriteLine("Thankyou..!!"); } }
public void Menu() { bool EXITApp = false; while (EXITApp != true) { Console.WriteLine("-----___WELCOME TO E-Shop___------"); Console.WriteLine("1.\t Login"); Console.WriteLine("2.\t Signup "); Console.WriteLine("3.\t Exit"); int selectedOption = Convert.ToInt32(Console.ReadLine()); switch (selectedOption) { case 1: Console.WriteLine("---___Login___---"); userRecords.Login(); //Console.Clear(); // EXITApp = true; break; case 2: Console.WriteLine("---___SignUp___---"); userRecords.SignupAll(); // Console.Clear(); // EXITApp = true; break; case 3: Console.WriteLine("Thankyou For Visit..!!\nExiting...!!"); EXITApp = true; break; default: Console.WriteLine("Invalid Operation"); break; } } }