示例#1
0
        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);
            }
        }
示例#2
0
        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;
        }
示例#3
0
        public ContactUserComment CreateComment(
                ContactUser contact,
                String content
        ) {
            var comment = new ContactUserComment();
            comment.Content = content;
            comment.CreatedAt = DateTime.Today;
            contact.Comments.Add(comment);

            return comment;
        }
示例#4
0
 public bool RemoveContact(ContactUser contact)
 {
     return Contacts.Remove(contact);
 }
示例#5
0
        public ContactManager AddContact(ContactUser contact)
        {
            Contacts.Add(contact);

            return this;
        }