public void ShowContact(ContactUser contact) { Console.WriteLine("{0}\t{1}", contact.Name, contact.Mobile); Console.WriteLine("\tGender: {0}\tBirthday: {1}", contact.Gender, contact.Birthday); Console.WriteLine("\tCompany: {0}\tAddress: {1}", contact.Company, contact.Address); Console.WriteLine("\tUser Comments:"); foreach (var comment in contact.Comments) { Console.WriteLine("\t\t{0}", comment.Content); } }
public ContactUser CreateContact( String name, ContactUser.ContactGender gender, String address, DateTime birthday, String company, String mobile ) { var contact = new ContactUser(); contact.Name = name; contact.Gender = gender; contact.Address = address; contact.Birthday = birthday; contact.Company = company; contact.Mobile = mobile; return contact; }
public ContactUserComment CreateComment( ContactUser contact, String content ) { var comment = new ContactUserComment(); comment.Content = content; comment.CreatedAt = DateTime.Today; contact.Comments.Add(comment); return comment; }
public bool RemoveContact(ContactUser contact) { return Contacts.Remove(contact); }
public ContactManager AddContact(ContactUser contact) { Contacts.Add(contact); return this; }