Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. static void MainMenu()
  2. {
  3. char choice;
  4.  
  5. // Main menu
  6.  
  7. Console.WriteLine("Press [1] to Login as Admin");
  8. Console.WriteLine("Press [2] to Login as Student");
  9. choice = char.Parse(Console.ReadLine());
  10.  
  11. if (choice !='1' && choice != '2')
  12. {
  13. Console.WriteLine("Invalid Choice");
  14.  
  15. MainMenu();
  16. }
  17.  
  18. else {
  19.  
  20. switch (choice)
  21. {
  22. //Admin menu
  23. case '1':
  24. Console.WriteLine("Please Enter the Admin name : ");
  25. string adminName = Console.ReadLine();
  26. Console.WriteLine("Please Enter the Password : ");
  27. string adminPassword = Console.ReadLine();
  28.  
  29.  
  30. if (LoginAdmin(adminName, adminPassword))
  31. {
  32. AdminMenu();
  33.  
  34. }
  35. else
  36. {
  37. Console.WriteLine("Invalid Username or Password !");
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement