Beispiel #1
0
        public void Show()
        {
            while (true)
            {
                AdminViewOption selectedOption = RenderMenu();
                switch (selectedOption)
                {
                case AdminViewOption.ManageUsers:
                    UserManagementView userManagementView = new UserManagementView();
                    userManagementView.Show();
                    break;

                case AdminViewOption.ManageTasks:
                    TaskManagementView taskManagementView = new TaskManagementView();
                    taskManagementView.Show();
                    break;

                case AdminViewOption.ManageComments:
                    CommentsView commentsView = new CommentsView();
                    commentsView.Show();
                    break;

                case AdminViewOption.Logout:
                    AuthenticationService.LoggedUser = null;
                    return;

                default:
                    throw new NotImplementedException("Reached default - this shouldn't happen in that case");
                }
            }
        }
Beispiel #2
0
        public void Show()
        {
            while (true)
            {
                Console.Clear();
                while (true)
                {
                    Console.Clear();
                    Console.WriteLine("Administration View:");
                    Console.WriteLine("[U]ser Management");
                    Console.WriteLine("[T]ask Management");
                    Console.WriteLine("E[x]it");

                    string input = Console.ReadLine();
                    switch (input.ToUpper())
                    {
                    case "U":
                    {
                        UserManagementView view = new UserManagementView();
                        view.Show();
                        break;
                    }

                    case "T":
                    {
                        TaskManagementView view = new TaskManagementView();
                        view.Show();
                        break;
                    }

                    case "X":
                    {
                        return;
                    }

                    default:
                    {
                        Console.WriteLine("Invalid choice");
                        Console.ReadKey(true);
                        break;
                    }
                    }
                }
            }
        }