예제 #1
0
 public CONTACT_INFO CreateContactInfo(ContactInfoViewModel contactInfoList)
 {
     return(new CONTACT_INFO
     {
         MEMBER_ID = contactInfoList.MemberId,
         CONTACT_METHOD_ID = contactInfoList.ContactMethodId,
         CONTACT_INFO1 = contactInfoList.ContactInfo
     });
 }
예제 #2
0
        public List <ContactInfoViewModel> CreateContactInfoViewModelList(ContactInfoViewModel contact)
        {
            var contactInfo = new List <ContactInfoViewModel>();

            if (!string.IsNullOrEmpty(contact.HomePhoneNumber))
            {
                contactInfo.Add(new ContactInfoViewModel()
                {
                    MemberId = contact.MemberId, ContactMethodId = 1, ContactInfo = contact.HomePhoneNumber
                });
            }

            if (!string.IsNullOrEmpty(contact.CellPhoneNumber))
            {
                contactInfo.Add(new ContactInfoViewModel()
                {
                    MemberId = contact.MemberId, ContactMethodId = 2, ContactInfo = contact.CellPhoneNumber
                });
            }

            if (!string.IsNullOrEmpty(contact.Email))
            {
                contactInfo.Add(new ContactInfoViewModel()
                {
                    MemberId = contact.MemberId, ContactMethodId = 3, ContactInfo = contact.Email
                });
            }

            if (contact.IsContactInfoPanelDisabled)
            {
                contactInfo.Add(new ContactInfoViewModel()
                {
                    MemberId = contact.MemberId, ContactMethodId = 0, ContactInfo = "No Contact Info"
                });
            }

            return(contactInfo);
        }