Beispiel #1
0
 // RoommateManager constructor that takes in the parentUI
 public RoommateManager(IUserInterfaceManager parentUI, string connectionString)
 {
     _parentUI           = parentUI;
     _roommateRepository = new RoommateRepository(connectionString);
     _roomRepository     = new RoomRepository(connectionString);
     _connectionString   = connectionString;
 }
Beispiel #2
0
        static void SearchRoommate(RoommateRepository roommateRepo)
        {
            while (true)
            {
                try
                {
                    Console.Write("Roommate Id: ");
                    int      id       = int.Parse(Console.ReadLine());
                    Roommate roommate = roommateRepo.GetById(id);

                    if (roommate == null)
                    {
                        throw new Exception();
                    }

                    Console.WriteLine($"{roommate.Firstname}'s rent portion is ${roommate.RentPortion}, occupies {roommate.Room.Name}.");
                    ContinueMenu();
                    break;
                }
                catch
                {
                    continue;
                }
            }
        }
Beispiel #3
0
        static void AssignChoreToRoommate(ChoreRepository choreRepo, RoommateRepository roommateRepo)
        {
            List <Chore>    chores    = choreRepo.GetAll();
            List <Roommate> roommates = roommateRepo.GetAll();

            foreach (Chore c in chores)
            {
                Console.WriteLine($"{c.Id} - {c.Name}");
            }
            Console.Write("Select chore: ");
            int choreChoice = int.Parse(Console.ReadLine());

            foreach (Roommate r in roommates)
            {
                Console.WriteLine($"{r.Id} - {r.FirstName}");
            }
            Console.Write("Select roommate: ");
            int roommateChoice = int.Parse(Console.ReadLine());

            choreRepo.AssignChore(choreChoice, roommateChoice);

            Chore    chore    = choreRepo.GetById(choreChoice);
            Roommate roommate = roommateRepo.GetById(roommateChoice);

            Console.WriteLine($"{chore.Name} has been assigned to {roommate.FirstName}");
            Console.Write("Press any key to continue");
            Console.ReadKey();
        }
Beispiel #4
0
        private static void ReassignChore(ChoreRepository choreRepo, RoommateRepository roommateRepo)
        {
            List <Chore> assignedChores = choreRepo.GetAssignedChores();

            foreach (Chore chore in assignedChores)
            {
                Console.WriteLine($"{chore.Id} - {chore.Name}");
            }
            Console.Write("Chore to reassign: ");
            int choreSelection = int.Parse(Console.ReadLine());

            Roommate roommateChore = roommateRepo.GetRoommateChoreById(choreSelection);

            Console.WriteLine($"This chore is currently assigned to {roommateChore.FirstName}. Who would you like to assign it to?");

            List <Roommate> roommates = roommateRepo.GetAll();

            foreach (Roommate roommate in roommates)
            {
                Console.WriteLine($"{roommate.Id} - {roommate.FirstName}");
            }
            Console.Write("Roommate to be assigned chore: ");
            int roommateSelection = int.Parse(Console.ReadLine());

            choreRepo.ReassignChore(choreSelection, roommateSelection, roommateChore.Id);

            Roommate roommateAssigned = roommateRepo.GetById(roommateSelection);

            Console.WriteLine($"Chore successfully reassigned to {roommateAssigned.FirstName}");
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Beispiel #5
0
        static void AssignRoommateChore(ChoreRepository choreRepo, RoommateRepository roommateRepo)
        {
            Console.WriteLine("----------------------");
            Console.WriteLine("Chores");
            Console.WriteLine("----------------------");
            List <Chore> chores = choreRepo.GetAll();

            chores.ForEach(c => Console.WriteLine($"{c.Id} - {c.Name}"));
            Console.WriteLine("");
            Console.Write("Enter chore Id: ");
            int choreId = int.Parse(Console.ReadLine());

            List <Roommate> roommates = roommateRepo.GetAll();

            Console.WriteLine("");
            Console.WriteLine("----------------------");
            Console.WriteLine("Roommates");
            Console.WriteLine("----------------------");
            roommates.ForEach(r => Console.WriteLine($"{r.Id} - {r.Firstname}"));
            Console.WriteLine("");
            Console.Write("Enter roommate Id: ");
            int roommateId = int.Parse(Console.ReadLine());

            Chore    selectedChore    = chores.Find(c => c.Id == choreId);
            Roommate selectedRoommate = roommates.Find(r => r.Id == roommateId);

            choreRepo.AssignChore(roommateId, choreId);
            Console.WriteLine($"{selectedRoommate.Firstname} is assign to {selectedChore.Name}");
            ContinueMenu();
        }
        private static void AddARoommate(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            Console.Clear();
            string message   = "Enter your new roommate's first name";
            string firstName = MooseSays(message);

            Console.Clear();
            message = "Thanks! Now enter your new roommate's last name";
            string lastName = MooseSays(message);

            Console.Clear();
            message = "Sweet! What percentage of the rent will your roommate pay?";
            int RentPortion;

            do
            {
                RentPortion = intMooseSays(message);
            } while (RentPortion < 1 || RentPortion > 100);
            Console.Clear();
            if (RentPortion <= 10)
            {
                message = "Cheapskate, huh?";
            }
            else if (RentPortion > 10 && RentPortion <= 70)
            {
                message = "Sounds reasonable.";
            }
            else if (RentPortion > 70)
            {
                message = "Hey moneybags!";
            }
            message += " Which room do they get?";
            int RoomId = intMooseSays(message);

            message = "Still wanna have them move in?";
            Console.Clear();
            string save = SaveMooseSays(message);

            if (save == "y")
            {
                Roommate newRoomate = new Roommate()
                {
                    Firstname   = firstName,
                    Lastname    = lastName,
                    RentPortion = RentPortion,
                    MoveInDate  = DateTime.Now,
                    RoomId      = RoomId
                };

                roommateRepo.Insert(newRoomate);
                Console.Clear();
                RoommatePage(roomRepo, roommateRepo);
            }
            else
            {
                RoommatePage(roomRepo, roommateRepo);
            }
        }
Beispiel #7
0
        static void GetSingleRoommate(RoommateRepository roommateRepo)
        {
            Console.WriteLine("----------------------------");
            Console.WriteLine("Getting Roommate with Id 2");

            Roommate singleRoommate = roommateRepo.GetById(2);

            Console.WriteLine($"{singleRoommate.Id} {singleRoommate.Firstname} {singleRoommate.Lastname} {singleRoommate.RentPortion} {singleRoommate.MovedInDate}");
        }
Beispiel #8
0
        static void EditRoommate(RoommateRepository roommateRepo)
        {
            Roommate roommateToEdit = roommateRepo.GetById(3);

            roommateToEdit.RentPortion = 20;

            roommateRepo.Update(roommateToEdit);
            Console.WriteLine($"{roommateToEdit.Firstname} {roommateToEdit.Lastname} has been updated!");
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            RoomRepository roomRepo = new RoomRepository(CONNECTION_STRING);

            Console.WriteLine("Getting All Rooms:");
            Console.WriteLine();

            List <Room> allRooms = roomRepo.GetAll();

            foreach (Room room in allRooms)
            {
                Console.WriteLine($"{room.Id} {room.Name} {room.MaxOccupancy}");
            }
            Room bathroom = new Room
            {
                Name         = "Bathroom",
                MaxOccupancy = 1
            };

            roomRepo.Insert(bathroom);

            Console.WriteLine("-------------------------");
            Console.WriteLine($"Added the new Room with id {bathroom.Id}");


            foreach (Room room in allRooms)
            {
                Console.WriteLine($"{room.Id} {room.Name} {room.MaxOccupancy}");
            }
            roomRepo.Delete(8);

            Console.WriteLine("Deleting");

            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);

            Console.WriteLine("Getting All Roommates:");
            Console.WriteLine();

            List <Roommate> allRoommates = roommateRepo.GetAll();

            foreach (Roommate roommate in allRoommates)
            {
                Console.WriteLine($"{roommate.Id} {roommate.Firstname} {roommate.Room}");
                Console.WriteLine();
                // Console.WriteLine("Getting Roommate with specific Id");

                // Roommate singleRoommate = roommateRepo.GetById(1);
                //Console.WriteLine($"{singleRoommate.Id} {singleRoommate.Firstname}");
            }
            Roommate Aaron = new Roommate
            {
                Firstname = "Aaron"
            };

            roommateRepo.Insert(Aaron);
            Console.WriteLine($"Added new roommate: {Aaron.Firstname}");
        }
Beispiel #10
0
        static void PrintRoommates(RoommateRepository roommateRepo)
        {
            List <Roommate> roommates = roommateRepo.GetAll();

            foreach (Roommate rm in roommates)
            {
                Console.WriteLine($"{rm.Id} - {rm.Firstname} - {rm.RentPortion}");
            }
        }
Beispiel #11
0
            static void searchForRoommate(RoommateRepository roommateRepo)
            {
                Console.Write("Roommate Id: ");
                int      roommateId = int.Parse(Console.ReadLine());
                Roommate roommate   = roommateRepo.GetById(roommateId);

                Console.WriteLine($"{roommate.Firstname} - Rent Portion: {roommate.RentPortion}% - {roommate.Room.Name}");
                Console.Write("Press any key to continue");
                Console.ReadKey();
            }
Beispiel #12
0
        static void GetAllRoommates(RoommateRepository roommateRepo)
        {
            Console.WriteLine("\nGetting All Roommates");
            Console.WriteLine("---------------------");
            List <Roommate> allRoommates = roommateRepo.GetAll();

            foreach (Roommate roommate in allRoommates)
            {
                Console.WriteLine($"{roommate.Id} {roommate.Firstname} {roommate.Lastname} {roommate.RentPortion} {roommate.MovedInDate}");
            }
        }
Beispiel #13
0
        static void SearchForRoommate(RoommateRepository roommateRepo)
        {
            Console.Write("Roommate id: ");
            int id = int.Parse(Console.ReadLine());

            Roommate roommate = roommateRepo.GetById(id);

            Console.WriteLine($"{roommate.Id} - {roommate.FirstName} Rent Portion({roommate.RentPortion}) Room Name({roommate.Room.Name})");
            Console.Write("Press any key to continue");
            Console.ReadKey();
        }
Beispiel #14
0
        static void ShowRoommate(RoommateRepository roomieRepo)
        {
            Console.Write("Roommate Id: ");
            int id = int.Parse(Console.ReadLine());

            Roommate roommate = roommateRepo.GetById(id);

            Console.WriteLine($"{roommate.Id} - {roommate.Name}");
            Console.Write("Press any key to continue");
            Console.ReadKey();
        }
Beispiel #15
0
        static void ShowOneRoommate(RoommateRepository roommateRepo)
        {
            Console.Write("Roommate Id: ");
            int id = int.Parse(Console.ReadLine());

            Roommate roommate = roommateRepo.GetById(id);

            Console.WriteLine($"{roommate.Id} - {roommate.Firstname} {roommate.Lastname} {roommate.RentPortion} {roommate.MovedInDate} {roommate.Room.Name}");
            Console.Write("Press any key to continue");
            Console.ReadKey();
        }
Beispiel #16
0
        static void AssignChore(ChoreRepository choreRepo, RoommateRepository roommateRepo)
        {
            List <Chore>    allChores    = choreRepo.GetAll();
            List <Roommate> allRoommates = roommateRepo.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 assign:");
            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 assignedChore = allChores[choreNum - 1];

            // Select a roommate
            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($"\nAssign {assignedChore.Name} to a roommate:");
            for (int i = 1; i < allRoommates.Count + 1; i++)
            {
                Console.WriteLine($"{i}) {allRoommates[i-1].Firstname} {allRoommates[i-1].Lastname}");
            }
            Console.WriteLine();
            userSelection  = Console.ReadLine();
            validSelection = int.TryParse(userSelection, out int roommateNum);
            while (!validSelection || roommateNum < 0 || roommateNum > allRoommates.Count)
            {
                Console.WriteLine("Invalid selection");
                userSelection  = Console.ReadLine();
                validSelection = int.TryParse(userSelection, out roommateNum);
            }
            Roommate assignedRoommate = allRoommates[roommateNum - 1];

            choreRepo.Assign(assignedChore, assignedRoommate);

            Console.WriteLine($"{assignedChore.Name} has been assigned to {assignedRoommate.Firstname}");
        }
Beispiel #17
0
        static void GetRoommatesInRoom(RoommateRepository roommateRepo)
        {
            // Get all roommates in the Living Room (room id of 3)
            Console.WriteLine("\nGetting All Roommates in the Living Room");
            Console.WriteLine("------------------------------------------");
            List <Roommate> roommatesInRoom = roommateRepo.GetAllWithRoom(3);

            foreach (Roommate roommate in roommatesInRoom)
            {
                Console.WriteLine($"{roommate.Id} {roommate.Firstname} {roommate.Lastname} {roommate.RentPortion} {roommate.MovedInDate} {roommate.Room.Name}");
            }
        }
        static void Main(string[] args)
        {
            RoomRepository     roomRepo     = new RoomRepository(CONNECTION_STRING);
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);

            Console.Clear();



            Console.WriteLine();
            MainPage(roomRepo, roommateRepo);
        }
        static void Main(string[] args)
        {
            RoomRepository roomRepo = new RoomRepository(CONNECTION_STRING);

            Console.WriteLine("Getting All Rooms:");
            Console.WriteLine();

            List <Room> allRooms = roomRepo.GetAll();

            foreach (Room room in allRooms)
            {
                Console.WriteLine($"{room.Id} {room.Name} {room.MaxOccupancy}");
            }

            Console.WriteLine("----------------------------");
            //Console.WriteLine("Getting Room with Id 1");

            //Room singleRoom = roomRepo.GetById(1);

            //Console.WriteLine($"{singleRoom.Id} {singleRoom.Name} {singleRoom.MaxOccupancy}");
            //adding bathroom
            //Room bathroom = new Room
            //{
            //    Name = "Bathroom",
            //    MaxOccupancy = 1
            //};

            //roomRepo.Insert(bathroom);

            //Room shed = new Room
            //{
            //    Name = "Shed",
            //    MaxOccupancy = 50
            //};
            //roomRepo.Insert(shed);

            Console.WriteLine("-------------------------------");
            //Console.WriteLine($"Added the new Room with id {shed.Id} and name of {shed.Name}");
            //bathroom.MaxOccupancy = 18;
            //roomRepo.Update(bathroom);

            //Console.WriteLine($" bathrooms occupancy is {bathroom.Id}");

            //roomRepo.Delete(9);
            //roomRepo.GetAll();
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);
            List <Roommate>    withRoom     = roommateRepo.GetAllWithRoom(3);

            foreach (Roommate rm in withRoom)
            {
                Console.WriteLine($"{rm.Firstname} is living in the {rm.Room.Name}");
            }
        }
        private static Roommate RoommateValueUpdater(int id, RoommateRepository roommateRepo)
        {
            Roommate singleRoommate = roommateRepo.GetById(id);
            int      choice;

            do
            {
                Console.Clear();
                HouseBot();
                Console.WriteLine("What would you like to change?");
                Console.WriteLine($"1) First Name \t{singleRoommate.Firstname}");
                Console.WriteLine($"2) Last Name \t{singleRoommate.Lastname}");
                Console.WriteLine($"3) Rent% \t{singleRoommate.RentPortion}");
                Console.WriteLine($"4) Move In \t{singleRoommate.MoveInDate}");
                Console.WriteLine($"5) Room Id \t{singleRoommate.RoomId}");
                Console.WriteLine($"6) I'm finished");
                choice = getChoice();
                if (choice == 1)
                {
                    Console.WriteLine("Enter a new first name");
                    singleRoommate.Firstname = Console.ReadLine();
                }
                else if (choice == 2)
                {
                    Console.WriteLine("Enter a new last name");
                    singleRoommate.Lastname = Console.ReadLine();
                }
                else if (choice == 3)
                {
                    Console.WriteLine("Enter the new rent protion");
                    do
                    {
                        singleRoommate.RentPortion = getChoice();
                    } while (singleRoommate.RentPortion < 1 || singleRoommate.RentPortion > 100);
                }
                else if (choice == 4)
                {
                    Console.WriteLine("Enter the correct move in date");


                    singleRoommate.MoveInDate = UpdateDate();
                }
                else if (choice == 5)
                {
                    Console.WriteLine("Enter their new room assignment");
                    singleRoommate.RoomId = getChoice();
                }
            } while (choice != 6);

            return(singleRoommate);
        }
        private static void RoommatePage(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            int choice;

            HouseBot();
            Console.WriteLine("Roommate management");
            Console.WriteLine("-------------------");
            Console.WriteLine("\t 1) View all Roommates");
            Console.WriteLine("\t 2) View a single Roommate");
            Console.WriteLine("\t 3) Add a new Roommate");
            Console.WriteLine("\t 4) Update a Roommate file");
            Console.WriteLine("\t 5) Remove a roommate");
            Console.WriteLine("\t 6) Return to main page");
            Console.WriteLine("\t 7) Exit");
            do
            {
                choice = getChoice();
            } while (choice < 1 || choice > 7);

            if (choice == 1)
            {
                ViewAllRoommates(roomRepo, roommateRepo);
            }
            else if (choice == 2)
            {
                ViewSingleRoommate(roomRepo, roommateRepo);
            }
            else if (choice == 3)
            {
                AddARoommate(roomRepo, roommateRepo);
            }
            else if (choice == 4)
            {
                UpdateARoommate(roomRepo, roommateRepo);
            }
            else if (choice == 5)
            {
                DeleteARoommate(roomRepo, roommateRepo);
            }
            else if (choice == 6)
            {
                Console.Clear();
                MainPage(roomRepo, roommateRepo);
            }
            else if (choice == 7)
            {
                string message = "Sorry Folks, the park's closed.";
                MooseSaysGoodbye(message);
            }
        }
Beispiel #22
0
        static void ChoreReport(ChoreRepository choreRepo, RoommateRepository roommateRepo)
        {
            Dictionary <Chore, Roommate> allAssignments = choreRepo.GetAllAssignments();

            Console.Clear();
            Console.SetCursorPosition((Console.WindowWidth - 26) / 2, Console.CursorTop);
            Console.WriteLine("All Chores and Assignments");
            Console.SetCursorPosition((Console.WindowWidth - 26) / 2, Console.CursorTop);
            Console.WriteLine("--------------------------\n");

            foreach (KeyValuePair <Chore, Roommate> assignment in allAssignments)
            {
                Console.WriteLine($"{assignment.Key.Name}: {assignment.Value.Firstname} {assignment.Value.Lastname}");
            }
        }
Beispiel #23
0
        static void Main(string[] args)
        {
            RoomRepository     roomRepo   = new RoomRepository(CONNECTION_STRING);
            ChoreRepository    choreRepo  = new ChoreRepository(CONNECTION_STRING);
            RoommateRepository roomieRepo = new RoommateRepository(CONNECTION_STRING);

            bool runProgram = true;

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

                switch (selection)
                {
                case ("Show all rooms"):
                    ShowAllRooms(roomRepo);
                    break;

                case ("Search for room"):
                    ShowOneRoom(roomRepo);
                    break;

                case ("Add a room"):
                    AddOneRoom(roomRepo);
                    break;

                case ("Show all chores"):
                    ShowAllChores(choreRepo);
                    break;

                case ("Search for chore"):
                    ShowOneChore(choreRepo);
                    break;

                case ("Add a chore"):
                    AddOneChore(choreRepo);
                    break;

                case ("Search for roomate"):
                    ShowRoommate(roomieRepo);
                    break;

                case ("Exit"):
                    runProgram = false;
                    break;
                }
            }
        }
Beispiel #24
0
        static void UpdateRoommate()
        {
            // Update Roommate
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);

            Console.WriteLine("------------------ Roommate List -------------------");
            ListAllRoommates();
            Console.WriteLine("----------- Enter the Id of the Roommate You'd Like to Edit  -------------");
            Roommate roommate   = roommateRepo.GetById(Int32.Parse(Console.ReadLine()));
            string   rmResponse = null;

            Console.WriteLine("Enter a new first name for the roommate or press ENTER");
            rmResponse = Console.ReadLine();
            if (rmResponse != "")
            {
                roommate.FirstName = rmResponse;
            }
            Console.WriteLine("Enter a new last name for the roommate or press ENTER");
            rmResponse = Console.ReadLine();
            if (rmResponse != "")
            {
                roommate.LastName = rmResponse;
            }
            Console.WriteLine("Enter a whole number rent portion for this roommate or press ENTER");
            rmResponse = Console.ReadLine();
            if (rmResponse != "")
            {
                roommate.RentPortion = Int32.Parse(rmResponse);
            }
            Console.WriteLine("Enter a new move in date for the roommate MM-DD-YY or press ENTER: ");
            rmResponse = Console.ReadLine();
            if (rmResponse != "")
            {
                roommate.MoveInDate = DateTime.Parse(rmResponse);
            }
            Console.WriteLine("Enter the Room ID for the roommate or press ENTER: ");
            GetRooms();
            rmResponse = Console.ReadLine();
            if (rmResponse != "")
            {
                roommate.Room = GetRoom(Int32.Parse(rmResponse));
            }
            roommateRepo.Update(roommate);
            roommate = roommateRepo.GetById(roommate.Id);
            Console.WriteLine("Here is the Updated Roommate:");
            Console.WriteLine("First Name \t Last name \t Rent Portion \t Move In Date \t Room Name \t Max Occupancy");
            Console.WriteLine($"{roommate.Id} {roommate.FirstName}\t{roommate.LastName}\t{roommate.RentPortion}\t{roommate.MoveInDate}\t{roommate.Room.Name}\t{ roommate.Room.MaxOccupancy}");
        }
Beispiel #25
0
        static void AddNewRoommate(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            Roommate fred = new Roommate()
            {
                Firstname   = "Friedrich",
                Lastname    = "Franzferdinand",
                RentPortion = 25,
                MovedInDate = new DateTime(2020, 03, 04),
                Room        = roomRepo.GetById(5)
            };

            roommateRepo.Insert(fred);

            Console.WriteLine("\n-----------------------------");
            Console.WriteLine($"Added new roommate with id {fred.Id}");
        }
Beispiel #26
0
        static void RoommateReport(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            // Display a report of all roommates and their rooms
            Console.WriteLine("\nReport -- All Roommates and their Rooms");
            Console.WriteLine("=======================================");
            List <Room> allRooms = roomRepo.GetAll();

            foreach (Room room in allRooms)
            {
                List <Roommate> roommatesInRoom = roommateRepo.GetAllWithRoom(room.Id);
                foreach (Roommate roommate in roommatesInRoom)
                {
                    Console.WriteLine($"{roommate.Firstname} {roommate.Lastname}: {room.Name}");
                }
            }
        }
Beispiel #27
0
        static void ListAllRoommates()
        {
            // Get list of roommates
            RoomRepository     roomRepo     = new RoomRepository(CONNECTION_STRING);
            RoommateRepository roommateRepo = new RoommateRepository(CONNECTION_STRING);

            Console.WriteLine("----------- Get Roommate List -------------");
            List <Roommate> AllRoommates = roommateRepo.GetAll();

            Console.WriteLine("First Name \t Last name \t Rent Portion \t Move In Date \t Room Name \t Max Occupancy");
            foreach (Roommate roommate in AllRoommates)
            {
                Console.WriteLine($"{roommate.Id}\t{roommate.FirstName}\t{roommate.LastName}\t{roommate.RentPortion}\t{roommate.MoveInDate}\t{roommate.Room.Name}\t{roommate.Room.MaxOccupancy}");
            }
            ;
        }
        private static void ViewAllRoommates(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            Console.Clear();
            HouseBot();
            List <Roommate> allRoommates = roommateRepo.GetAll();

            foreach (Roommate roommate in allRoommates)
            {
                Console.WriteLine($"{roommate.Id} {roommate.Firstname} {roommate.Lastname} {roommate.MoveInDate} {roommate.RentPortion}");
            }

            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
            Console.Clear();
            RoommatePage(roomRepo, roommateRepo);
        }
        private static void DeleteARoommate(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            string          message      = "Who's been voted out?";
            List <Roommate> allRoommates = roommateRepo.GetAll();


            int id;

            do
            {
                id = intMooseSays(message, allRoommates);
            }   while (!allRoommates.Any(rm => rm.Id == id));


            roommateRepo.Delete(id);

            Console.Clear();
            RoommatePage(roomRepo, roommateRepo);
        }
        private static void UpdateARoommate(RoomRepository roomRepo, RoommateRepository roommateRepo)
        {
            string          message      = "Which roommate would you like to update?";
            List <Roommate> allRoommates = roommateRepo.GetAll();

            int id;

            do
            {
                id = intMooseSays(message, allRoommates);
            }while (!allRoommates.Any(rm => rm.Id == id));

            Console.Clear();
            Roommate roommateToUpdate = RoommateValueUpdater(id, roommateRepo);

            roommateRepo.Update(roommateToUpdate);
            Console.Clear();
            RoommatePage(roomRepo, roommateRepo);
        }