public void UserChoice() { switch (dataInput.GetNextAction()) { case Action.Create: adressBook.CreatePerson(dataInput.GetPerson()); break; case Action.Find: adressBook.FindPerson(dataInput.Find()); break; case Action.ListAll: adressBook.ListAllContacts(); break; case Action.Delete: adressBook.RemovePersonFromList(dataInput.Delete()); break; case Action.Edit: var userInput = dataInput.Edit(); WhatToEdit(); } }
public void UserChoice() { switch (dataInput.GetNextAction()) { case Action.Create: adressBook.CreatePerson(dataInput.GetPerson()); break; case Action.Find: Person person = adressBook.FindPerson(dataInput.Find()); dataInput.NullCheck(person); dataInput.PersonInformation(person); break; case Action.ListAll: dataInput.ReturnAllContacts(adressBook.ListAllContacts()); break; case Action.Delete: Person person1 = adressBook.FindPerson(dataInput.Delete()); dataInput.NullCheck(person1); adressBook.RemovePersonFromList(person1); break; case Action.Edit: Person person2 = adressBook.FindPerson(dataInput.Edit()); EditPerson(person2); break; } }