Beispiel #1
0
        private static void CreateTestData()
        {
            var dataContext = new RockContext();

            var definedTypeService = new DefinedTypeService(dataContext);

            var attributes1 = new Dictionary <string, object>();

            attributes1.Add("core_CountryAddressLine1Requirement", DataEntryRequirementLevelSpecifier.Required);
            attributes1.Add("core_CountryAddressLine2Requirement", DataEntryRequirementLevelSpecifier.Required);
            attributes1.Add("core_CountryAddressCityRequirement", DataEntryRequirementLevelSpecifier.Required);
            attributes1.Add("core_CountryAddressStateRequirement", DataEntryRequirementLevelSpecifier.Required);
            attributes1.Add("core_CountryAddressLocalityRequirement", DataEntryRequirementLevelSpecifier.Required);
            attributes1.Add("core_CountryAddressPostalCodeRequirement", DataEntryRequirementLevelSpecifier.Required);

            definedTypeService.AddOrUpdateValue(SystemGuid.DefinedType.LOCATION_COUNTRIES, CountryCodeWithMandatoryAddressRequirements, "Test-1", attributes1);

            var attributes2 = new Dictionary <string, object>();

            attributes2.Add("core_CountryAddressLine1Requirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes2.Add("core_CountryAddressLine2Requirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes2.Add("core_CountryAddressCityRequirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes2.Add("core_CountryAddressStateRequirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes2.Add("core_CountryAddressLocalityRequirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes2.Add("core_CountryAddressPostalCodeRequirement", DataEntryRequirementLevelSpecifier.Optional);

            definedTypeService.AddOrUpdateValue(SystemGuid.DefinedType.LOCATION_COUNTRIES, CountryCodeWithOptionalAddressRequirements, "Test-2", attributes2);

            var attributes3 = new Dictionary <string, object>();

            attributes3.Add("core_CountryAddressLine1Requirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes3.Add("core_CountryAddressLine2Requirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes3.Add("core_CountryAddressCityRequirement", DataEntryRequirementLevelSpecifier.Required);
            attributes3.Add("core_CountryAddressStateRequirement", DataEntryRequirementLevelSpecifier.Required);
            attributes3.Add("core_CountryAddressLocalityRequirement", DataEntryRequirementLevelSpecifier.Optional);
            attributes3.Add("core_CountryAddressPostalCodeRequirement", DataEntryRequirementLevelSpecifier.Optional);

            definedTypeService.AddOrUpdateValue(SystemGuid.DefinedType.LOCATION_COUNTRIES, CountryCodeWithMixedAddressRequirements, "Test-3", attributes3);
        }