static void Main(string[] args) { string lagi = ""; do { char pilihan; Console.WriteLine("=============== Pilih Data ================="); Console.WriteLine("1. Supplier"); Console.WriteLine("2. Item"); Console.WriteLine("3. Transaction"); Console.WriteLine("============================================"); Console.Write("Pilihan mu : "); pilihan = Convert.ToChar(Console.ReadLine()); switch (pilihan) { case '1': ManageSupplier supplier = new ManageSupplier(); supplier.Supplier(); Console.Write("Kembali ke Menu Utama? (y/n) : "); lagi = Console.ReadLine(); break; case '2': ManageItem item = new ManageItem(); item.Item(); Console.Write("Kembali ke Menu Utama? (y/n) : "); lagi = Console.ReadLine(); break; case '3': ManageTransactionItem tranItem = new ManageTransactionItem(); ManageTransaction tran = new ManageTransaction(); tran.Transact(); tranItem.TranItem(); Console.Write("Kembali ke Menu Utama? (y/n) : "); lagi = Console.ReadLine(); break; default: Console.WriteLine("Pilihan tidak ada!"); Console.Write("Kembali ke Menu Utama? (y/n) : "); lagi = Console.ReadLine(); break; } } while (lagi == "y"); }
public void Section() { Console.WriteLine("============ Manage Table ============="); Console.WriteLine("1. Supplier"); Console.WriteLine("2. Item"); Console.WriteLine("3. Transaction"); //Console.WriteLine("4. Struck Transaction"); Console.WriteLine("======================================="); Console.Write("Going to : "); int chance = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("======================================="); switch (chance) { case 1: ManageSupplier supplier = new ManageSupplier(); supplier.MenuSupplier(); break; case 2: ManageItem item = new ManageItem(); item.MenuItem(); break; case 3: ManageTransaction transaction = new ManageTransaction(); transaction.MenuTransaction(); break; //case 4: // Console.WriteLine("Insert Id Transaction"); // Console.Read(); // //ManageTransactionItem transactionitem = new ManageTransactionItem(); // //transactionitem.MenuTransactionItem(); // break; default: Console.Write("Please Try Again"); Console.Read(); break; } }