using System.Collections.Generic; using Common.Library.CustomObjects; using System.Linq; namespace Common.Library.DTO.Websites.DMCDynamics.LLC { public class CompanyInfoDTO { public string CompanyName { get; set; } public string PhoneNumber { get; set; } public string EmailAddress { get; set; } public string Address { get; set; } public string CompanySlogan { get; set; } public PhoneNumberContainer FormattedPhoneNumber { get { List phoneNumber = PhoneNumber.Split(" ").Select(val => val.Trim()).ToList(); return new PhoneNumberContainer { AreaCode = phoneNumber[0], PhoneNumber = phoneNumber[1] }; } } public AddressContainer FormattedAddress { get { List address = Address.Split(",").Select(val => val.Trim()).ToList(); string houseNumber = address[0].Substring(0, address[0].IndexOf(" ")).Trim(); string streetName = address[0].Substring(address[0].IndexOf(" ")).Trim(); string city = address[1].Trim(); string state = address[2].Substring(0, address[2].IndexOf(" ")).Trim(); string zip = address[2].Substring(address[2].IndexOf(" ")).Trim(); return new AddressContainer { HouseNumber = houseNumber, StreetName = streetName, City = city, State = state, Zip = zip }; } } } public class CompanyInfoDTOCollection : List { } }