public string AcquirePhoneNumberToAdd() // acceptes only not existing numbers { string pn = null; string filler = ""; while (true) { pn = UserDialog.AcquireStringFormated(filler + "phone number", PhoneBook.PhoneNumberFilter, "digits only"); if (phoneBook.Exists(pn)) { Console.WriteLine("This phone number already exists. Impossible to add"); filler = "another "; } else { break; } } return(pn); }
public string AcquirePhoneNumberToCheck() { return(UserDialog.AcquireStringFormated("phone number", PhoneBook.PhoneNumberFilter, "digits only")); }