示例#1
0
 public Contact(Internal.ContactItem item)
 {
     this.Id           = item.Id;
     this.Email        = item.Email;
     this.FaxNumber    = item.Fax;
     this.FirstName    = item.FirstName;
     this.LastName     = item.LastName;
     this.CompanyName  = item.CompanyName;
     this.MobileNumber = item.MobilePhone;
     this.PhoneNumber  = item.Phone;
     this.Title        = item.Title;
     this.Type         = (ContactVisibility)Enum.Parse(typeof(ContactVisibility), item.Type, true);
     this.OwnerId      = item.OwnerId;
 }
示例#2
0
        public static Internal.ContactItem ToContactItem(this Contact obj)
        {
            var item = new Internal.ContactItem();

            item.Id          = obj.Id;
            item.Email       = obj.Email;
            item.Fax         = obj.FaxNumber;
            item.FirstName   = obj.FirstName;
            item.LastName    = obj.LastName;
            item.CompanyName = obj.CompanyName;
            item.MobilePhone = obj.MobileNumber;
            item.Phone       = obj.PhoneNumber;
            item.Title       = obj.Title;
            item.Type        = obj.Type.ToString();
            item.OwnerId     = obj.OwnerId;

            return(item);
        }