コード例 #1
0
        static void EditChore(ChoreRepository choreRepo)
        {
            List <Chore> allChores = choreRepo.GetAll();

            // Select a chore
            Console.Clear();
            Console.SetCursorPosition((Console.WindowWidth - 13) / 2, Console.CursorTop);
            Console.WriteLine("Assign Chores");
            Console.SetCursorPosition((Console.WindowWidth - 13) / 2, Console.CursorTop);
            Console.WriteLine("-------------");
            Console.WriteLine("\nPlease choose a chore to edit:");
            for (int i = 1; i < allChores.Count + 1; i++)
            {
                Console.WriteLine($"{i}) {allChores[i-1].Name}");
            }
            Console.WriteLine();
            string userSelection  = Console.ReadLine();
            bool   validSelection = int.TryParse(userSelection, out int choreNum);

            while (!validSelection || choreNum < 0 || choreNum > allChores.Count)
            {
                Console.WriteLine("Invalid selection");
                userSelection  = Console.ReadLine();
                validSelection = int.TryParse(userSelection, out choreNum);
            }
            Chore editedChore = allChores[choreNum - 1];

            Console.WriteLine("Please enter a new name for this chore:");
            editedChore.Name = Console.ReadLine();

            choreRepo.Update(editedChore);

            Console.WriteLine($"{editedChore.Name} has been updated.");
        }
コード例 #2
0
        static void UpdateChore(ChoreRepository choreRepo)
        {
            List <Chore> chores = choreRepo.GetAll();

            chores.ForEach(c => Console.WriteLine($"{c.Id} - {c.Name}"));

            Console.Write("Which chore would you like to update? ");
            int   selectedChoreId = int.Parse(Console.ReadLine());
            Chore selectedChore   = chores.FirstOrDefault(c => c.Id == selectedChoreId);

            Console.Write("New Chore Name: ");
            selectedChore.Name = Console.ReadLine();

            choreRepo.Update(selectedChore);
            Console.WriteLine($"Chore has been successfully updated");
            ContinueMenu();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: TAPinson/Roommates
            static void updateChore(ChoreRepository choreRepo)
            {
                List <Chore> choresToUpdate = choreRepo.GetAll();

                foreach (Chore c in choresToUpdate)
                {
                    Console.WriteLine($"{c.Id} - {c.Name}");
                }
                Console.Write("Select a chore to update ");
                int choreUpdateId = int.Parse(Console.ReadLine());

                Console.Write("Enter the new name: ");
                string choreUpdateName = Console.ReadLine();

                choreRepo.Update(choreUpdateId, choreUpdateName);
                Console.Write("Press any key to continue");
                Console.ReadKey();
            }
コード例 #4
0
        static void EditChore()
        {
            string          choreResponse;
            ChoreRepository choreRepo = new ChoreRepository(CONNECTION_STRING);

            ListChores();
            Console.WriteLine("Enter the ID of the Chore to edit: ");
            Chore chore = choreRepo.GetById(Int32.Parse(Console.ReadLine()));

            Console.WriteLine("Enter the new name of the chore or press ENTER to cancel: ");
            choreResponse = Console.ReadLine();
            if (choreResponse != "")
            {
                chore.Name = choreResponse;
                choreRepo.Update(chore);
                Console.WriteLine("Chore has been updated.");
                ListChores();
            }
        }
コード例 #5
0
        private static void UpdateChore(ChoreRepository choreRepo)
        {
            List <Chore> choreOptions = choreRepo.GetAll();

            foreach (Chore c in choreOptions)
            {
                Console.WriteLine($"{c.Id} - {c.Name}");
            }

            Console.Write("Which chore would you like to update? ");
            int   selectedChoreId = int.Parse(Console.ReadLine());
            Chore selectedChore   = choreOptions.FirstOrDefault(c => c.Id == selectedChoreId);

            Console.Write("New Name: ");
            selectedChore.Name = Console.ReadLine();

            choreRepo.Update(selectedChore);

            Console.WriteLine($"Chore has been successfully updated");
            Console.Write("Press any key to continue");
            Console.ReadKey();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            RoomRepository     roomRepo     = new RoomRepository(CONNECTION_STRING);
            ChoreRepository    choreRepo    = new ChoreRepository(CONNECTION_STRING);
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);

            bool runProgram = true;

            while (runProgram)
            {
                string selection = GetMenuSelection();

                switch (selection)
                {
                //room case commands
                case ("Show all rooms"):
                    List <Room> rooms = roomRepo.GetAll();
                    foreach (Room r in rooms)
                    {
                        Console.WriteLine($"{r.Name} has an Id of {r.Id} and a max occupancy of {r.MaxOccupancy}");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for room"):
                    Console.Write("Room Id: ");
                    int id = int.Parse(Console.ReadLine());

                    Room room = roomRepo.GetById(id);

                    Console.WriteLine($"{room.Id} - {room.Name} Max Occupancy({room.MaxOccupancy})");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a room"):
                    Console.Write("Room name: ");
                    string name = Console.ReadLine();

                    Console.Write("Max occupancy: ");
                    int max = int.Parse(Console.ReadLine());

                    Room roomToAdd = new Room()
                    {
                        Name         = name,
                        MaxOccupancy = max
                    };

                    roomRepo.Insert(roomToAdd);

                    Console.WriteLine($"{roomToAdd.Name} has been added and assigned an Id of {roomToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a room"):
                    List <Room> roomOptions = roomRepo.GetAll();
                    foreach (Room r in roomOptions)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name} Max Occupancy({r.MaxOccupancy})");
                    }

                    Console.Write("Which room would you like to update? ");
                    int  selectedRoomId = int.Parse(Console.ReadLine());
                    Room selectedRoom   = roomOptions.FirstOrDefault(r => r.Id == selectedRoomId);

                    Console.Write("New Name: ");
                    selectedRoom.Name = Console.ReadLine();

                    Console.Write("New Max Occupancy: ");
                    selectedRoom.MaxOccupancy = int.Parse(Console.ReadLine());

                    roomRepo.Update(selectedRoom);

                    Console.WriteLine($"Room has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete a room"):
                    List <Room> deleteOptions = roomRepo.GetAll();
                    foreach (Room d in deleteOptions)
                    {
                        Console.WriteLine($"{d.Id} - {d.Name} Max Occupancy({d.MaxOccupancy})");
                    }
                    Console.WriteLine("Please note you may not delete a room if people are living in it");
                    Console.Write("Which empty room would you like to delete?");
                    int  deletedRoomId = int.Parse(Console.ReadLine());
                    Room deletedRoom   = deleteOptions.FirstOrDefault(d => d.Id == deletedRoomId);

                    roomRepo.Delete(deletedRoomId);

                    Console.WriteLine($"Room has been successful deleted");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;


                //chore case commands
                case ("Show all chores"):
                    List <Chore> chores = choreRepo.GetAll();
                    foreach (Chore c in chores)
                    {
                        Console.WriteLine($"{c.Name} has an Id of {c.Id}");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for chore"):
                    Console.Write("Chore Id: ");
                    int choreId = int.Parse(Console.ReadLine());

                    Chore chore = choreRepo.GetById(choreId);

                    Console.WriteLine($"{chore.Id} - {chore.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a chore"):
                    Console.Write("Chore name: ");
                    string choreName = Console.ReadLine();

                    Chore choreToAdd = new Chore()
                    {
                        Name = choreName,
                    };

                    choreRepo.Insert(choreToAdd);

                    Console.WriteLine($"{choreToAdd.Name} has been added and assigned an Id of {choreToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a chore"):
                    List <Chore> choreOptions = choreRepo.GetAll();
                    foreach (Chore c in choreOptions)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }

                    Console.Write("Which chore would you like to update? ");
                    int   selectedChoreId = int.Parse(Console.ReadLine());
                    Chore selectedChore   = choreOptions.FirstOrDefault(c => c.Id == selectedChoreId);

                    Console.Write("New Name: ");
                    selectedChore.Name = Console.ReadLine();

                    choreRepo.Update(selectedChore);

                    Console.WriteLine("Chore has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete a chore"):
                    List <Chore> deleteChores = choreRepo.GetAll();
                    foreach (Chore d in deleteChores)
                    {
                        Console.WriteLine($"{d.Id} - {d.Name}");
                    }
                    Console.Write("Which chore would you like to delete?");
                    int   deletedChoreId = int.Parse(Console.ReadLine());
                    Chore deletedChore   = deleteChores.FirstOrDefault(d => d.Id == deletedChoreId);

                    choreRepo.Delete(deletedChoreId);

                    Console.WriteLine("Chore has been successful deleted");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                //select a roommate by id

                case ("Search for roommate"):
                    Console.Write("Roommate Id: ");
                    int roommateId = int.Parse(Console.ReadLine());

                    Roommate roommate = roommateRepo.GetById(roommateId);

                    Console.WriteLine($"{roommate.Id} - {roommate.FirstName} {roommate.LastName} pays {roommate.RentPortion}% of the rent. They live in {roommate.Room.Name}.");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;



                case ("Exit"):
                    runProgram = false;
                    break;
                }
            }
        }
コード例 #7
0
        static void Main(string[] args)
        {
            RoomRepository     roomRepo     = new RoomRepository(CONNECTION_STRING);
            ChoreRepository    choreRepo    = new ChoreRepository(CONNECTION_STRING);
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);
            bool runProgram = true;

            while (runProgram)
            {
                string selection = GetMenuSelection();

                switch (selection)
                {
                case ("Show all rooms"):
                    List <Room> rooms = roomRepo.GetAll();
                    foreach (Room r in rooms)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name} Max Occupancy({r.MaxOccupancy})");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for room"):
                    Console.Write("Room Id: ");
                    int id = int.Parse(Console.ReadLine());

                    Room room = roomRepo.GetById(id);

                    Console.WriteLine($"{room.Id} - {room.Name} Max Occupancy({room.MaxOccupancy})");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a room"):
                    Console.Write("Room name: ");
                    string name = Console.ReadLine();

                    Console.Write("Max occupancy: ");
                    int max = int.Parse(Console.ReadLine());

                    Room roomToAdd = new Room()
                    {
                        Name         = name,
                        MaxOccupancy = max
                    };

                    roomRepo.Insert(roomToAdd);
                    Console.WriteLine($"{roomToAdd.Name} has been added and assigned an Id of {roomToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Show all chores"):
                    List <Chore> chores = choreRepo.GetAll();
                    foreach (Chore c in chores)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for chore"):
                    Console.WriteLine("Chore Id: ");
                    int   choreId = int.Parse(Console.ReadLine());
                    Chore chore   = choreRepo.GetById(choreId);
                    Console.WriteLine($"{chore.Id} - {chore.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a chore"):
                    Console.WriteLine("Chore name: ");
                    string choreName  = Console.ReadLine();
                    Chore  choreToAdd = new Chore()
                    {
                        Name = choreName
                    };
                    choreRepo.Insert(choreToAdd);
                    Console.WriteLine($"{choreToAdd.Name} has been added and assigned an Id of {choreToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for roommate"):
                    Console.WriteLine("Roommate Id: ");
                    int      roommateId = int.Parse(Console.ReadLine());
                    Roommate roommate   = roommateRepo.GetById(roommateId);
                    Console.WriteLine($"{roommate.Firstname}:");
                    Console.WriteLine($"    Rent Portion:{roommate.RentPortion}");
                    Console.WriteLine($"    Room: {roommate.Room.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Unassigned chores"):
                    List <Chore> unassignedchores = choreRepo.UnassignedChores();
                    foreach (Chore c in unassignedchores)
                    {
                        Console.WriteLine(c.Name);
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Assign chore to roommate"):
                    List <Chore>    choreList    = choreRepo.GetAll();
                    List <Roommate> roommateList = roommateRepo.GetAll();
                    foreach (Chore c in choreList)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.WriteLine("Please enter the id of the chore.");
                    int   choreIdToAdd = int.Parse(Console.ReadLine());
                    Chore chore1       = choreRepo.GetById(choreIdToAdd);
                    foreach (Roommate r in roommateList)
                    {
                        Console.WriteLine($"{r.Id} - {r.Firstname} {r.Lastname}");
                    }
                    Console.WriteLine("Please enter the id of the roommate.");
                    int      roommateIdToAdd = int.Parse(Console.ReadLine());
                    Roommate roommate1       = roommateRepo.GetById(roommateIdToAdd);
                    choreRepo.assignChore(roommateIdToAdd, choreIdToAdd);
                    Console.WriteLine($"{roommate1.Firstname} {roommate1.Lastname} has been assigned to {chore1.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a room"):
                    List <Room> roomOptions = roomRepo.GetAll();
                    foreach (Room r in roomOptions)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name} Max Occupancy({r.MaxOccupancy})");
                    }

                    Console.Write("Which room would you like to update? ");
                    int  selectedRoomId = int.Parse(Console.ReadLine());
                    Room selectedRoom   = roomOptions.FirstOrDefault(r => r.Id == selectedRoomId);

                    Console.Write("New Name: ");
                    selectedRoom.Name = Console.ReadLine();

                    Console.Write("New Max Occupancy: ");
                    selectedRoom.MaxOccupancy = int.Parse(Console.ReadLine());

                    roomRepo.Update(selectedRoom);

                    Console.WriteLine($"Room has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete room"):
                    List <Room> allRooms = roomRepo.GetAll();
                    foreach (Room r in allRooms)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name}");
                    }
                    Console.WriteLine("Selecet the Id of the room to delete.");
                    int roomToDelete = int.Parse(Console.ReadLine());
                    roomRepo.Delete(roomToDelete);
                    break;

                case ("Update a chore"):
                    List <Chore> choreOptions = choreRepo.GetAll();
                    foreach (Chore c in choreOptions)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.WriteLine("Which chore would you like to update?");
                    int   selectedChoreId = int.Parse(Console.ReadLine());
                    Chore selectedChore   = choreOptions.FirstOrDefault(c => c.Id == selectedChoreId);
                    Console.WriteLine("New Name: ");
                    selectedChore.Name = Console.ReadLine();
                    choreRepo.Update(selectedChore);
                    Console.WriteLine("Chore has been successfully updates.");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete chore"):
                    List <Chore> allChore = choreRepo.GetAll();
                    foreach (Chore c in allChore)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.WriteLine("Selecet the Id of the chore to delete.");
                    int choreToDelete = int.Parse(Console.ReadLine());
                    choreRepo.Delete(choreToDelete);
                    break;

                case ("Exit"):
                    runProgram = false;
                    break;
                }
            }
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: rickiele/Roommates
        static void Main(string[] args)
        {
            RoomRepository  roomRepo  = new RoomRepository(CONNECTION_STRING);
            ChoreRepository choreRepo = new ChoreRepository(CONNECTION_STRING);

            bool runProgram = true;

            while (runProgram)
            {
                string selection = GetMenuSelection();

                switch (selection)
                {
                case ("Show all rooms"):
                    List <Room> rooms = roomRepo.GetAll();
                    foreach (Room r in rooms)
                    {
                        Console.WriteLine($"{r.Name} has an Id of {r.Id} and a max occupancy of {r.MaxOccupancy}");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for room"):
                    Console.Write("Room Id: ");
                    int id = int.Parse(Console.ReadLine());

                    Room room = roomRepo.GetById(id);

                    Console.WriteLine($"{room.Id} - {room.Name} Max Occupancy({room.MaxOccupancy})");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a room"):
                    Console.Write("Room name: ");
                    string name = Console.ReadLine();

                    Console.Write("Max occupancy: ");
                    int max = int.Parse(Console.ReadLine());

                    Room roomToAdd = new Room()
                    {
                        Name         = name,
                        MaxOccupancy = max
                    };

                    roomRepo.Insert(roomToAdd);

                    // Print out name of INSERT room - Id that was set by the INSERT method
                    Console.WriteLine($"{roomToAdd.Name} has been added and assigned an Id of {roomToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a chore"):
                    Console.Write("Chore name: ");
                    string choreName = Console.ReadLine();

                    Chore choreToAdd = new Chore()
                    {
                        Name = choreName
                    };

                    choreRepo.Insert(choreToAdd);

                    Console.WriteLine($"{choreToAdd.Name} has been added and assigned an Id of {choreToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a room"):
                    List <Room> roomOptions = roomRepo.GetAll();
                    foreach (Room r in roomOptions)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name} Max Occupancy({r.MaxOccupancy})");
                    }

                    Console.Write("Which room would you like to update? ");
                    int  selectedRoomId = int.Parse(Console.ReadLine());
                    Room selectedRoom   = roomOptions.FirstOrDefault(r => r.Id == selectedRoomId);

                    Console.Write("New Name: ");
                    selectedRoom.Name = Console.ReadLine();

                    Console.Write("New Max Occupancy: ");
                    selectedRoom.MaxOccupancy = int.Parse(Console.ReadLine());

                    roomRepo.Update(selectedRoom);

                    Console.WriteLine($"Room has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a chore"):
                    List <Chore> choreOptions = choreRepo.GetAll();
                    foreach (Chore c in choreOptions)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }

                    Console.Write("Which chore would you like to update? ");
                    int   selectedChoreId = int.Parse(Console.ReadLine());
                    Chore selectedChore   = choreOptions.FirstOrDefault(c => c.Id == selectedChoreId);

                    Console.Write("New Chore: ");
                    selectedChore.Name = Console.ReadLine();

                    choreRepo.Update(selectedChore);

                    Console.WriteLine("Chore has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete a room"):
                    List <Room> deleteRoomOptions = roomRepo.GetAll();
                    foreach (Room r in deleteRoomOptions)
                    {
                        Console.WriteLine($"{r.Id} - {r.Name} Max Occupancy({r.MaxOccupancy})");
                    }
                    Console.Write("Which room would you like to delete? ");
                    int  selectedRoomToDeleteId = int.Parse(Console.ReadLine());
                    Room selectedRoomToDelete   = deleteRoomOptions.FirstOrDefault(r => r.Id == selectedRoomToDeleteId);

                    roomRepo.Delete(selectedRoomToDeleteId);
                    break;

                case ("Delete a chore"):
                    List <Chore> deleteChoreOptions = choreRepo.GetAll();
                    foreach (Chore c in deleteChoreOptions)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.Write("Which chore would you like to delete? ");
                    int   selectedChoreToDeleteId = int.Parse(Console.ReadLine());
                    Chore selectedChoreToDelete   = deleteChoreOptions.FirstOrDefault(c => c.Id == selectedChoreToDeleteId);

                    choreRepo.Delete(selectedChoreToDeleteId);
                    break;

                case ("Show all chores"):
                    List <Chore> chores = choreRepo.GetAll();
                    foreach (Chore c in chores)
                    {
                        Console.WriteLine($"{c.Name} has an Id of {c.Id}.");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for chore"):
                    Console.Write("Chore Id: ");
                    int choreId = int.Parse(Console.ReadLine());

                    Chore chore = choreRepo.GetById(choreId);

                    Console.WriteLine($"{chore.Id} - {chore.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Exit"):
                    runProgram = false;
                    break;
                }
            }
        }
コード例 #9
0
        static void Main(string[] args)
        {
            RoomRepository     roomRepo  = new RoomRepository(CONNECTION_STRING);
            ChoreRepository    choreRepo = new ChoreRepository(CONNECTION_STRING);
            RoommateRepository rmRepo    = new RoommateRepository(CONNECTION_STRING);

            bool runProgram = true;

            while (runProgram)
            {
                string selection = GetMenuSelection();

                switch (selection)
                {
                case ("Show all rooms"):
                    ListAllRooms();
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;


                case ("Show all chores"):
                    ListAllChores();
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;


                case ("Search for room"):
                    Console.Write("Room Id: ");
                    int  id   = int.Parse(Console.ReadLine());
                    Room room = roomRepo.GetById(id);

                    Console.WriteLine($"{room.Id} - {room.Name} Max Occupancy({room.MaxOccupancy})");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for chore"):
                    Console.WriteLine("Chore Id: ");
                    int   choreId = int.Parse(Console.ReadLine());
                    Chore chore   = choreRepo.GetById(choreId);
                    Console.WriteLine($"{chore.Id} - {chore.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Search for a roommate"):
                    Console.WriteLine("Roommate Id: ");
                    int      roommateId = int.Parse(Console.ReadLine());
                    Roommate roommate   = rmRepo.GetById(roommateId);
                    Console.WriteLine($"{roommate.Id} - {roommate.FirstName} {roommate.LastName} - {roommate.Room.Name}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a room"):
                    Console.Write("Room name: ");
                    string name = Console.ReadLine();

                    Console.Write("Max occupancy: ");
                    int  max       = int.Parse(Console.ReadLine());
                    Room roomToAdd = new Room()
                    {
                        Name         = name,
                        MaxOccupancy = max
                    };
                    roomRepo.Insert(roomToAdd);
                    Console.WriteLine($"{roomToAdd.Name} has been added and assigned an Id of {roomToAdd.Id}");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a room"):
                    List <Room> roomOptions = ListAllRooms("return");
                    Console.Write("Which room would you like to update? ");
                    int  selectedRoomId = int.Parse(Console.ReadLine());
                    Room selectedRoom   = roomOptions.FirstOrDefault(r => r.Id == selectedRoomId);
                    Console.Write("New Name: ");
                    selectedRoom.Name = Console.ReadLine();
                    Console.Write("New Max Occupancy: ");
                    selectedRoom.MaxOccupancy = int.Parse(Console.ReadLine());
                    roomRepo.Update(selectedRoom);
                    Console.WriteLine($"Room has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Delete a room"):
                    ListAllRooms();
                    Console.Write("Which room would you like to delete? ");
                    int deletedRoomId = int.Parse(Console.ReadLine());
                    roomRepo.Delete(deletedRoomId, "Room");
                    Console.WriteLine($"Room has been successfully deleted");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Add a chore"):
                    Console.WriteLine("Chore Name: ");
                    string choreName  = Console.ReadLine();
                    Chore  choreToAdd = new Chore()
                    {
                        Name = choreName
                    };
                    choreRepo.Insert(choreToAdd);
                    Console.WriteLine($"{choreToAdd.Name} has been added and assigned an Id of {choreToAdd.Id}");
                    Console.WriteLine("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Update a chore"):
                    List <Chore> choreOptions = ListAllChores("return");
                    Console.Write("Which chore would you like to update? ");

                    int   selectedChoreId = int.Parse(Console.ReadLine());
                    Chore selectedChore   = choreOptions.FirstOrDefault(r => r.Id == selectedChoreId);

                    Console.Write("New Name: ");
                    selectedChore.Name = Console.ReadLine();

                    choreRepo.Update(selectedChore);

                    Console.WriteLine($"Chore has been successfully updated");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;



                case ("Delete a chore"):
                    ListAllChores();
                    Console.Write("Which chore would you like to delete? ");
                    int deletedChoreId = int.Parse(Console.ReadLine());
                    choreRepo.Delete(deletedChoreId);
                    Console.WriteLine($"Chore has been successfully deleted");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Show all unassigned chores"):
                    List <Chore> unassignedChores = choreRepo.GetUnassignedChores();
                    foreach (Chore c in unassignedChores)
                    {
                        Console.WriteLine($"{c.Id} - {c.Name}");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;



                case ("Assign chore to roommate"):
                    ListAllChores();
                    Console.WriteLine("Select the id of the chore you want to assign.");
                    int             assignChoreId = int.Parse(Console.ReadLine());
                    List <Roommate> roommates     = rmRepo.GetAll();
                    foreach (Roommate r in roommates)
                    {
                        Console.WriteLine($"{r.Id} - {r.FirstName} {r.LastName})");
                    }
                    Console.WriteLine("Select the id of the roommate you want to assign the chore to.");
                    int selectedRmId = int.Parse(Console.ReadLine());
                    choreRepo.AssignChore(selectedRmId, assignChoreId);
                    Console.WriteLine("Chore assigned");
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;



                case ("Check the chore assignment count"):
                    List <ChoreCount> counts = choreRepo.GetChoreCounts();
                    foreach (ChoreCount count in counts)
                    {
                        Console.WriteLine($"{count.Name}: {count.Count} chores");
                    }
                    Console.Write("Press any key to continue");
                    Console.ReadKey();
                    break;

                case ("Exit"):
                    runProgram = false;
                    break;
                }
            }
        }