Advertisement
Guest User

Untitled

a guest
Nov 8th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1.  
  2. class Program
  3. {
  4. static void Main(string[] args)
  5. {
  6. var receptionistView = new ReceptionistMainView();
  7. var adminView = new AdminMainView();
  8.  
  9. Console.Write("Username: ");
  10. var userName = Console.ReadLine();
  11.  
  12. Console.Write("Password: ");
  13. var password = Console.ReadLine();
  14.  
  15. var authenticationService = new AuthentificationService();
  16.  
  17. var user = authenticationService.Authenticate(userName, password);
  18.  
  19. if (user != null)
  20. {
  21. Console.WriteLine("Succesfully logged in");
  22.  
  23. Console.WriteLine($"Role {user.Role}");
  24. if (user.Role == "Receptionist")
  25. {
  26. receptionistView.Display();
  27. }
  28. if(user.Role == "Admin")
  29. {
  30. adminView.Display();
  31. }
  32. if (user.Role == "Vetrinarian")
  33. {
  34.  
  35. }
  36.  
  37. }
  38. else
  39. {
  40. Console.WriteLine("Access denied!");
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement