Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public string AcquirePhoneNumberToCheck()
 {
     return(UserDialog.AcquireStringFormated("phone number",
                                             PhoneBook.PhoneNumberFilter, "digits only"));
 }