public static void CafeManagementSystem(Account a) { Console.Clear(); short imChoose; string[] mainMenu = { "Order Management", "Payout ", "Exit" }; do { imChoose = OrderConsole.Menu(" Cafe Management System ", mainMenu); switch (imChoose) { case 1: Console.Clear(); OrderConsole.Order(a); break; case 2: Console.Clear(); PayoutConsole.Payout(); break; } } while (imChoose != mainMenu.Length); }
public void GetItemInfoByID(User user) // hiển thị chi tiết trò chơi { Console.WriteLine("-----------------"); Console.Write("Nhập mã trò chơi: "); while (true) { bool isINT = Int32.TryParse(Console.ReadLine(), out itemid); try { item = itemBL.GetItemByID(itemid); } catch (System.Exception) { Console.WriteLine("Mất Kết nối!\nẤn phím bất kì để trở về trang chủ !"); Console.ReadKey(); m.MainMenu(); } if (!isINT) { Console.WriteLine("Nhập giá trị sai !"); Console.Write("Mời bạn nhập lại: "); } else if (itemBL.GetItemByID(itemid) == null) { Console.WriteLine("Mã game sai hoặc không tồn tại !"); Console.Write("Mời bạn nhập lại: "); } else { break; } } Console.Clear(); Console.WriteLine("|===============================================================|"); Console.WriteLine("|---------------------| THÔNG TIN TRÒ CHƠI |--------------------|"); Console.WriteLine("|===============================================================|"); Console.WriteLine($"- Mã trò chơi : {item.item_id}"); Console.WriteLine("----------------------------------------------------------------|"); Console.WriteLine($"- Tên trò chơi : {item.item_name}"); Console.WriteLine("|---------------------------------------------------------------|"); Console.WriteLine($"- Giá trò chơi : {FormatAndValid.FormatCurrency(item.item_price)}"); Console.WriteLine("|---------------------------------------------------------------|"); Console.WriteLine($"- Nhà phát triển : {item.item_developer}"); Console.WriteLine("|---------------------------------------------------------------|"); Console.WriteLine($"- Nhà phát hành : {item.item_publisher}"); Console.WriteLine("|---------------------------------------------------------------|"); Console.WriteLine($"- Thể loại : {item.item_tag}"); Console.WriteLine("|---------------------------------------------------------------|"); Console.WriteLine($"- Nền tảng : {item.item_platform}"); Console.WriteLine("|===============================================================|\n"); Console.WriteLine($"- Mô tả trò chơi : {item.item_description}"); fbc.ShowFeedBacks(user); // hiển thị phản hồi Console.WriteLine("\n1. Thêm vào giỏ hàng "); Console.WriteLine("2. Đánh giá trò chơi "); Console.WriteLine("3. Quay trở lại cửa hàng "); Console.Write("Chọn: "); int chooseAction; while (true) { bool isINT = Int32.TryParse(Console.ReadLine(), out chooseAction); if (!isINT) { Console.WriteLine("Nhập giá trị sai !"); Console.Write("Mời bạn nhập lại: "); } else if (chooseAction < 1 || chooseAction > 3) { Console.WriteLine("Nhập giá trị sai !"); Console.Write("Mời bạn nhập lại: "); } else { break; } } switch (chooseAction) { case 1: orderConsole.Order(user); break; case 2: fbc.CreateFeedBack(user); break; case 3: ShowItems(user); break; } }