/// <summary> /// Handles the GetRecipientMergeFields event of the gSteps control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="GetRecipientMergeFieldsEventArgs"/> instance containing the event data.</param> protected void gSteps_GetRecipientMergeFields(object sender, GetRecipientMergeFieldsEventArgs e) { Step stepRow = e.DataItem as Step; if (stepRow == null) { return; } var dataContext = GetDataContext(); var step = new StepService(dataContext).Get(stepRow.Id); step.LoadAttributes(); var mergefields = e.MergeValues; e.MergeValues.Add("StepStatus", step.StepStatus.Name); e.MergeValues.Add("StepName", step.StepType.Name); dynamic dynamicAttributeCarrier = new RockDynamic(); foreach (var attributeKeyValue in step.AttributeValues) { dynamicAttributeCarrier[attributeKeyValue.Key] = attributeKeyValue.Value.Value; } e.MergeValues.Add("StepAttributes", dynamicAttributeCarrier); }
/// <summary> /// Handles the GetRecipientMergeFields event of the pnlGroupMembers control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="GetRecipientMergeFieldsEventArgs"/> instance containing the event data.</param> private void pnlGroupMembers_GetRecipientMergeFields(object sender, GetRecipientMergeFieldsEventArgs e) { dynamic groupMember = e.DataItem; if (groupMember != null) { e.MergeValues.Add("GroupRole", groupMember.GroupRole); e.MergeValues.Add("GroupMemberStatus", ((GroupMemberStatus)groupMember.GroupMemberStatus).ConvertToString()); } }
private void GReport_GetRecipientMergeFields(object sender, GetRecipientMergeFieldsEventArgs e) { // Nothing here }
/// <summary> /// Handles the GetRecipientMergeFields event of the gGroupMembers control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="GetRecipientMergeFieldsEventArgs"/> instance containing the event data.</param> void gGroupMembers_GetRecipientMergeFields( object sender, GetRecipientMergeFieldsEventArgs e ) { dynamic groupMember = e.DataItem; if ( groupMember != null ) { e.MergeValues.Add( "GroupRole", groupMember.GroupRole ); e.MergeValues.Add( "GroupMemberStatus", ( (GroupMemberStatus)groupMember.GroupMemberStatus ).ConvertToString() ); } }