本文整理汇总了C#中Rock.Model.GroupService.AsDelimited方法的典型用法代码示例。如果您正苦于以下问题:C# GroupService.AsDelimited方法的具体用法?C# GroupService.AsDelimited怎么用?C# GroupService.AsDelimited使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.GroupService
的用法示例。
在下文中一共展示了GroupService.AsDelimited方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="entityType">Type of the entity.</param>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Type entityType, Control[] controls )
{
var pGroupPicker = controls[0] as GroupPicker;
var cbChildGroups = controls[1] as RockCheckBox;
var ddlIntegerCompare = controls[2] as DropDownList;
var tbAttendedCount = controls[3] as RockTextBox;
var slidingDateRangePicker = controls[4] as SlidingDateRangePicker;
// convert the date range from pipe-delimited to comma since we use pipe delimited for the selection values
var dateRangeCommaDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace( '|', ',' );
var groupGuids = new GroupService( new RockContext() ).GetByIds( pGroupPicker.ItemIds.AsIntegerList() ).Select( a => a.Guid ).ToList();
return string.Format( "{0}|{1}|{2}|{3}|{4}", groupGuids.AsDelimited( "," ), ddlIntegerCompare.SelectedValue, tbAttendedCount.Text, dateRangeCommaDelimitedValues, cbChildGroups.Checked.ToTrueFalse() );
}
示例2: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="entityType">Type of the entity.</param>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Type entityType, Control[] controls )
{
if ( controls.Count() < 8 )
{
return null;
}
GroupPicker groupPicker = controls[0] as GroupPicker;
RockCheckBox cbChildGroups = controls[1] as RockCheckBox;
RockCheckBox cbIncludeSelectedGroup = controls[2] as RockCheckBox;
RockCheckBox cbChildGroupsPlusDescendants = controls[3] as RockCheckBox;
RockCheckBoxList cblRoles = controls[4] as RockCheckBoxList;
RockDropDownList ddlGroupMemberStatus = controls[5] as RockDropDownList;
RockCheckBox cbInactiveGroups = controls[6] as RockCheckBox;
SlidingDateRangePicker addedOnDateRangePicker = controls[7] as SlidingDateRangePicker;
List<int> groupIdList = groupPicker.SelectedValues.AsIntegerList();
var groupGuids = new GroupService( new RockContext() ).GetByIds( groupIdList ).Select( a => a.Guid ).Distinct().ToList();
// convert pipe to comma delimited
var delimitedValues = addedOnDateRangePicker.DelimitedValues.Replace( "|", "," );
return string.Format(
"{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}",
groupGuids.AsDelimited( "," ),
cblRoles.SelectedValues.AsDelimited( "," ),
cbChildGroups.Checked.ToString(),
ddlGroupMemberStatus.SelectedValue,
cbIncludeSelectedGroup.Checked.ToString(),
cbChildGroupsPlusDescendants.Checked.ToString(),
cbIncludeInactiveGroups.Checked.ToString(),
delimitedValues );
}
示例3: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="entityType">Type of the entity.</param>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Type entityType, Control[] controls )
{
if ( controls.Count() < 6 )
{
return null;
}
GroupPicker groupPicker = controls[0] as GroupPicker;
RockCheckBox cbChildGroups = controls[1] as RockCheckBox;
RockCheckBox cbIncludeSelectedGroup = controls[2] as RockCheckBox;
RockCheckBox cbChildGroupsPlusDescendants = controls[3] as RockCheckBox;
RockCheckBoxList cblRoles = controls[4] as RockCheckBoxList;
RockDropDownList ddlGroupMemberStatus = controls[5] as RockDropDownList;
List<int> groupIdList = groupPicker.SelectedValues.AsIntegerList();
var groupGuids = new GroupService( new RockContext() ).GetByIds( groupIdList ).Select( a => a.Guid ).Distinct().ToList();
return string.Format(
"{0}|{1}|{2}|{3}|{4}|{5}",
groupGuids.AsDelimited( "," ),
cblRoles.SelectedValues.AsDelimited( "," ),
cbChildGroups.Checked.ToString(),
ddlGroupMemberStatus.SelectedValue,
cbIncludeSelectedGroup.Checked.ToString(),
cbChildGroupsPlusDescendants.Checked.ToString() );
}