Ejemplo n.º 1
0
        public static void NewUser()
        {
            Console.WriteLine();
            Console.Write("Contact Name : ");
            String name = Console.ReadLine();

            name = name.ToUpper();
            Console.WriteLine();

            List <PhoneNumbers> userNumb = new List <PhoneNumbers>();

            Console.Write("Contact Number : ");
            PhoneNumbers numb = new PhoneNumbers(Convert.ToInt64(Console.ReadLine()));

            userNumb.Add(numb);
            Console.WriteLine();

            Console.Write("Do you want to add more Number in this Contact Y/N : ");
            string cont = Console.ReadLine();

            while (cont == "Y" || cont == "y")
            {
                Console.Write("Contact Number : ");
                numb = new PhoneNumbers(Convert.ToInt64(Console.ReadLine()));
                Console.WriteLine();
                userNumb.Add(numb);


                Console.Write("Do you want to add more Number in this Contact Y/N : ");
                Console.WriteLine();
                cont = Console.ReadLine();
            }

            Console.Write("Address : ");
            String addr = Console.ReadLine();

            Console.WriteLine();


            User user = new User(name, userNumb, addr);

            allUsers.Add(user);
        }
Ejemplo n.º 2
0
 public void DeleteNumber(PhoneNumbers number)
 {
     phoneNumbers.Remove(number);
 }
Ejemplo n.º 3
0
 public void AddPhoneNumber(PhoneNumbers number)
 {
     phoneNumbers.Add(number);
 }