mirror of
https://github.com/stokebob/BealeEngineering.git
synced 2026-03-21 07:37:16 +00:00
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BealeEngineering.Core.Logic.Adapter
|
|
{
|
|
public class Contact
|
|
{
|
|
public Model.Contact.Contact XeroInvoiceFlatFile(Model.Import.XeroInvoiceFlatFile xeroInvoice)
|
|
{
|
|
var contact = new Model.Contact.Contact();
|
|
contact.ContactName = xeroInvoice.ContactName;
|
|
if (string.IsNullOrWhiteSpace(xeroInvoice.EmailAddress)) { contact.EmailAddress = null; }
|
|
else { contact.EmailAddress = xeroInvoice.EmailAddress; }
|
|
|
|
var address = new Model.Contact.Address();
|
|
address.AddressLine1 = xeroInvoice.POAddressLine1;
|
|
address.AddressLine2 = xeroInvoice.POAddressLine2;
|
|
address.AddressLine3 = xeroInvoice.POAddressLine3;
|
|
address.AddressLine4 = xeroInvoice.POAddressLine4;
|
|
address.City = xeroInvoice.POCity;
|
|
address.Country = xeroInvoice.POCountry;
|
|
address.PostalCode = xeroInvoice.POPostalCode;
|
|
address.Region = xeroInvoice.PORegion;
|
|
|
|
if (address.IsValid()) { contact.PostalAddress = address; }
|
|
|
|
return contact;
|
|
}
|
|
}
|
|
}
|