private int CreateAddressHouseholdForSponsoredChild(string town, string lastName) { if (!String.IsNullOrEmpty(town)) { var address = new MpPostalAddress { City = town, Line1 = "Not Known" }; return(CreateHouseholdAndAddress(lastName, address, ApiLogin())); } else { return(-1); } }
private int CreateHouseholdAndAddress(string householdName, MpPostalAddress address, string apiToken) { var addressDictionary = new Dictionary <string, object> { { "Address_Line_1", address.Line1 }, { "Address_Line_2", address.Line2 }, { "City", address.City }, { "State/Region", address.State }, { "Postal_Code", address.PostalCode } }; var addressId = _ministryPlatformService.CreateRecord(_addressesPageId, addressDictionary, apiToken); var householdDictionary = new Dictionary <string, object> { { "Household_Name", householdName }, { "Congregation_ID", _congregationDefaultId }, { "Household_Source_ID", _householdDefaultSourceId }, { "Address_ID", addressId } }; return(_ministryPlatformService.CreateRecord(_householdsPageId, householdDictionary, apiToken)); }