本文整理汇总了C#中Rock.Model.GroupService.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# GroupService.Insert方法的具体用法?C# GroupService.Insert怎么用?C# GroupService.Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.GroupService
的用法示例。
在下文中一共展示了GroupService.Insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doCheckinGroupStuff
protected void doCheckinGroupStuff()
{
int checkinConfigFilter = int.TryParse(gtpCheckinConfig.SelectedValue, out checkinConfigFilter) ? checkinConfigFilter : -1;
int checkinAreaFilter = int.TryParse(gtpCheckinArea.SelectedValue, out checkinAreaFilter) ? checkinAreaFilter : -1;
int checkinGroupFilter = int.TryParse(rddlCheckinGroup.SelectedValue, out checkinGroupFilter) ? checkinGroupFilter : -1;
int groupTypePurposeCheckInTemplateId = DefinedValueCache.Read(new Guid(Rock.SystemGuid.DefinedValue.GROUPTYPE_PURPOSE_CHECKIN_TEMPLATE)).Id;
List<GroupType> checkinConfigs = new GroupTypeService(_rockContext).Queryable().Where(a => a.GroupTypePurposeValueId == groupTypePurposeCheckInTemplateId).OrderBy(a => a.ParentGroupTypes.FirstOrDefault().Id).ThenBy(a => a.Order).ThenBy(a => a.Name).ToList();
gtpCheckinConfig.GroupTypes = checkinConfigs;
if (gtpCheckinConfig.Items.FindByValue(checkinConfigFilter.ToString()) != null)
{
gtpCheckinConfig.SelectedValue = checkinConfigFilter.ToString();
}
gtpCheckinArea.GroupTypes = getCGT(checkinConfigs.Where(a => a.Id == gtpCheckinConfig.SelectedGroupTypeId).ToList(), "");
if (gtpCheckinArea.Items.FindByValue(checkinAreaFilter.ToString()) != null)
{
gtpCheckinArea.SelectedValue = checkinAreaFilter.ToString();
}
List<Rock.Model.Group> checkinGroups = new GroupService(_rockContext).Queryable().Where(a => a.GroupTypeId == gtpCheckinArea.SelectedGroupTypeId).OrderBy(a => a.Order).ThenBy(a => a.Name).ToList();
checkinGroups.Insert(0, new Rock.Model.Group() { Name = "", Id = -1 });
rddlCheckinGroup.DataSource = checkinGroups;
rddlCheckinGroup.DataTextField = "Name";
rddlCheckinGroup.DataValueField = "Id";
rddlCheckinGroup.DataBind();
if (rddlCheckinGroup.Items.FindByValue(checkinGroupFilter.ToString()) != null)
{
rddlCheckinGroup.SelectedValue = checkinGroupFilter.ToString();
}
}