/// <summary> /// Binds the package grid. /// </summary> public void BindPackageGrid() { using ( var rockContext = new RockContext() ) { var definedValues = new DefinedValueService( rockContext ) .GetByDefinedTypeGuid( Rock.SystemGuid.DefinedType.PROTECT_MY_MINISTRY_PACKAGES.AsGuid() ) .ToList(); foreach( var definedValue in definedValues ) { definedValue.LoadAttributes( rockContext ); } gDefinedValues.DataSource = definedValues.Select( v => new { v.Id, v.Value, v.Description, PackageName = v.GetAttributeValue( "PMMPackageName" ), DefaultCounty = v.GetAttributeValue( "DefaultCounty" ), SendAddressCounty = v.GetAttributeValue( "SendHomeCounty" ).AsBoolean(), DefaultState = v.GetAttributeValue( "DefaultState" ), SendAddressState = v.GetAttributeValue( "SendHomeState" ).AsBoolean(), MVRJurisdication = v.GetAttributeValue("MVRJurisdiction"), SendAddressStateMVR = v.GetAttributeValue( "SendHomeStateMVR" ).AsBoolean() } ) .ToList(); gDefinedValues.DataBind(); } }