public static V2.CustomerData GetCustomerData(V1.ICustomerDataReader customerReader) { var v2CustomerData = new V2.CustomerData(); Dictionary <string, string> customerData = new Dictionary <string, string>(); customerReader.ReadData(customerData); string value; if (customerData.TryGetValue(customerReader.Key_Customer_CCProcessingID, out value)) { v2CustomerData.CustomerProfileID = value; } if (customerData.TryGetValue(customerReader.Key_CustomerCD, out value)) { v2CustomerData.CustomerCD = value; } if (customerData.TryGetValue(customerReader.Key_CustomerName, out value)) { v2CustomerData.CustomerName = value; } if (customerData.TryGetValue(customerReader.Key_BillContact_Email, out value)) { v2CustomerData.Email = value; } return(v2CustomerData); }
public static V2.AddressData GetAddressData(V1.ICustomerDataReader customerReader) { var addressData = new V2.AddressData(); Dictionary <string, string> customerData = new Dictionary <string, string>(); customerReader.ReadData(customerData); string value; if (customerData.TryGetValue(customerReader.Key_Customer_FirstName, out value)) { addressData.FirstName = value; } if (customerData.TryGetValue(customerReader.Key_Customer_LastName, out value)) { addressData.LastName = value; } if (customerData.TryGetValue(customerReader.Key_BillAddr_Address, out value)) { addressData.Address = value; } if (customerData.TryGetValue(customerReader.Key_BillAddr_City, out value)) { addressData.City = value; } if (customerData.TryGetValue(customerReader.Key_BillAddr_Country, out value)) { addressData.Country = value; } if (customerData.TryGetValue(customerReader.Key_BillAddr_PostalCode, out value)) { addressData.PostalCode = value; } if (customerData.TryGetValue(customerReader.Key_BillAddr_State, out value)) { addressData.State = value; } if (customerData.TryGetValue(customerReader.Key_BillContact_Email, out value)) { addressData.Email = value; } if (customerData.TryGetValue(customerReader.Key_BillContact_Fax, out value)) { addressData.Fax = value; } if (customerData.TryGetValue(customerReader.Key_BillContact_Phone, out value)) { addressData.Phone = value; } return(addressData); }