public void AdmiCatalogue() { ManageBook bookFunction = new ManageBook(); PublicUser manageUser = new PublicUser(); START: Console.WriteLine(""); Console.WriteLine("|============================================|"); Console.WriteLine("| ADMIN:CATALOGUE |"); Console.WriteLine("|============================================|"); Console.WriteLine("| 1.View Books |"); Console.WriteLine("| 2.Add Books |"); Console.WriteLine("| 3.Insert Books |"); Console.WriteLine("| 4.Remove Books |"); Console.WriteLine("| 5.View Public User Log. |"); Console.WriteLine("| 6.Exit |"); Console.WriteLine("|============================================|"); Console.WriteLine("| PLEASE CHOOSE ACCORDINGLY : INPUT A NUMBER |"); Console.WriteLine("|============================================|"); Console.WriteLine(""); int adminInput = int.Parse(Console.ReadLine()); if (adminInput == 1) { bookFunction.BookView(); goto START; } else if (adminInput == 2) { bookFunction.BookAdd(); goto START; } else if (adminInput == 3) { bookFunction.BookInsert(); goto START; } else if (adminInput == 4) { bookFunction.BookRemoved(); goto START; } else if (adminInput == 5) { manageUser.ViewUserLog(); goto START; } else { Console.WriteLine("Admin Catalogue Shuting down ... "); } }
static void Main(string[] args) { ManageBook Man = new ManageBook(); string ID; int input = 0; do { Clear(); WriteLine("***Welcome to Book Library System***"); WriteLine("1.Add new book"); WriteLine("2.Update book"); WriteLine("3.Delete Book"); WriteLine("4.Show all Book"); WriteLine("5.Quit"); Write("Choose: "); input = Validation.CheckInput(); switch (input) { //Add New book case 1: WriteLine("***Add new book***"); Man.AddNewBook(); ReadLine(); break; //Update Book case 2: WriteLine("***Update book by ID***"); Write("Enter ID: "); ID = Console.ReadLine(); Man.UpdateBook(ID); ReadLine(); break; //Delete Book case 3: WriteLine("***Delete Book by ID***"); Write("Enter ID: "); ID = Console.ReadLine(); Man.DeleteBook(ID); ReadLine(); break; //Show all Book case 4: WriteLine("***Show all Book***"); Man.ShowAll(); ReadLine(); break; case 5: WriteLine("Goodbye"); ReadLine(); break; default: WriteLine("Invalid Choice!"); ReadLine(); break; } } while (input != 5); }