static void Main(string[] args) { List <User> users = new List <User>(); string exit = string.Empty; bool isExit = false; Authorization log = new Authorization(users); bool isAdmin = log.EnterLogin(); AddingUsers addingUsers = new AddingUsers(users); if (isAdmin) { exit = addingUsers.SelectOptionForAdmin(); } while (true) { if (!string.IsNullOrEmpty(exit)) { var currentUser = log.RepeatLoggingIn(); if (currentUser == null) { addingUsers.SelectOptionForAdmin(); } else { isExit = addingUsers.SelectOptionForUser(currentUser); } } if (!isExit) { break; } } }
public Authorization(List <User> users) { this.users = users; adding = new AddingUsers(users); }