/** * Shows the practice editor. */ private void showPracticeEditor() { DentalPractice practiceToAdd; string location = ""; string address = ""; string receptionist; try { while (location == "") //Ensures a value is provided { Console.Write("Location: "); location = Console.ReadLine(); Console.Clear(); } while (address == "") { Console.Write("Address: "); address = Console.ReadLine(); Console.Clear(); } Console.Write("Receptionist: (leave blank to skip)"); receptionist = Console.ReadLine(); practiceToAdd = new DentalPractice(location, address, receptionist); //Creates practice with or without receptionist if (receptionist != "") //check if receptionist is blank { practiceToAdd.associateReceptionist(); //Associates the receptionist with practice } Application.appInstance.dentalPractices.Add(practiceToAdd); //Adds dental practice to the list DataIO.savePracticeFile(practiceToAdd); //Saves to file } catch (Exception e) { GeneralFunctions.errorHandler(e); } }