示例#1
0
 public static ZohoContact Map(ZohoContact contact, HSSupplier supplier,
                               HSAddressSupplier address, User user, ZohoCurrency currency)
 {
     return(new ZohoContact()
     {
         contact_id = contact.contact_id,
         company_name = supplier.ID,
         contact_name = supplier.Name,
         contact_type = "vendor",
         billing_address = ZohoAddressMapper.Map(address),
         shipping_address = ZohoAddressMapper.Map(address),
         contact_persons = contact.contact_persons = (contact.contact_persons != null &&
                                                      contact.contact_persons.Any(c => c.email == user.Email))
             ? new List <ZohoContactPerson>()
         {
             new ZohoContactPerson()
             {
                 email = user.Email,
                 first_name = user.FirstName,
                 last_name = user.LastName,
                 phone = user.Phone
             }
         }
             : null,
         currency_id = currency.currency_id
     });
 }
示例#2
0
 public static ZohoAddress Map(HSAddressSupplier address)
 {
     return(new ZohoAddress()
     {
         attention = address.CompanyName,
         address = address.Street1,
         street2 = address.Street2,
         city = address.City,
         state = address.State,
         zip = address.Zip,
         country = address.Country,
         phone = address.Phone,
         state_code = address.State
     });
 }