예제 #1
0
 public void Display()
 {
     Console.WriteLine("Details Are...");
     foreach (var value in list)
     {
         PersonalDetail Detail = value;
         Detail.Display();
     }
 }
예제 #2
0
        public void AddContacts(string FirstName, string LastName, string State, string Address, int Pincode, int MobileNumber)
        {
            bool duplicate = Equals(FirstName);

            if (duplicate)
            {
                Console.WriteLine($"Duplicate Contact not allowed '{0}' is already in address book", FirstName);
            }
            else
            {
                PersonalDetail user = new PersonalDetail(FirstName, LastName, State, Address, Pincode, MobileNumber);
                list.Add(user);
            }
        }