本文整理汇总了C#中Rock.Model.DefinedValueService.GetListByGuids方法的典型用法代码示例。如果您正苦于以下问题:C# DefinedValueService.GetListByGuids方法的具体用法?C# DefinedValueService.GetListByGuids怎么用?C# DefinedValueService.GetListByGuids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.DefinedValueService
的用法示例。
在下文中一共展示了DefinedValueService.GetListByGuids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
//.........这里部分代码省略.........
if (spiritualGift4 != null) SpiritualGift4 = Int32.Parse(spiritualGift4);
if (ability1 != null) Ability1 = Int32.Parse(ability1);
if (ability2 != null) Ability2 = Int32.Parse(ability2);
var intsOfGifts =
definedValueService.GetByIds(new List<int>
{
SpiritualGift1,
SpiritualGift2,
SpiritualGift3,
SpiritualGift4,
Ability1,
Ability2
});
spiritualGift1Guid = intsOfGifts.ToList()[SpiritualGift1].Guid.ToString();
spiritualGift2Guid = intsOfGifts.ToList()[SpiritualGift2].Guid.ToString();
spiritualGift3Guid = intsOfGifts.ToList()[SpiritualGift3].Guid.ToString();
spiritualGift4Guid = intsOfGifts.ToList()[SpiritualGift4].Guid.ToString();
ability1Guid = intsOfGifts.ToList()[Ability1].Guid.ToString();
ability2Guid = intsOfGifts.ToList()[Ability2].Guid.ToString();
}
else
{
spiritualGift1Guid = spiritualGift1;
spiritualGift2Guid = spiritualGift2;
spiritualGift3Guid = spiritualGift3;
spiritualGift4Guid = spiritualGift4;
ability1Guid = ability1;
ability2Guid = ability2;
}
// Get all of the data about the assiciated gifts and ability categories
var shapeGift1Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(spiritualGift1Guid) }).FirstOrDefault();
var shapeGift2Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(spiritualGift2Guid) }).FirstOrDefault();
var shapeGift3Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(spiritualGift3Guid) }).FirstOrDefault();
var shapeGift4Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(spiritualGift4Guid) }).FirstOrDefault();
var ability1Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(ability1Guid) }).FirstOrDefault();
var ability2Object = definedValueService.GetListByGuids(new List<Guid> { new Guid(ability2Guid) }).FirstOrDefault();
shapeGift1Object.LoadAttributes();
shapeGift2Object.LoadAttributes();
shapeGift3Object.LoadAttributes();
shapeGift4Object.LoadAttributes();
ability1Object.LoadAttributes();
ability2Object.LoadAttributes();
// Get heart choices Values from Guids
string heartCategoriesString = "";
if (!heartCategories.IsNullOrWhiteSpace())
{
string[] heartCategoryArray = heartCategories.Split(',');
foreach (string category in heartCategoryArray)
{
var definedValueObject =
definedValueService.Queryable().FirstOrDefault(a => a.Guid == new Guid(category));
if (category.Equals(heartCategoryArray.Last()))
{
heartCategoriesString += definedValueObject.Value;
}
else
{
heartCategoriesString += definedValueObject.Value + ", ";
}
}