コード例 #1
0
        private int CreateHouseholdAndAddress(string householdName, PostalAddress 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));
        }
コード例 #2
0
 private int CreateAddressHouseholdForSponsoredChild(string town, string lastName)
 {
     if (!String.IsNullOrEmpty(town))
     {
         var address = new PostalAddress
         {
             City = town,
             Line1 = "Not Known"
         };
         return  CreateHouseholdAndAddress(lastName, address, ApiLogin());
     }
     else
     {
         return -1;
     }
 }