本文整理汇总了C#中Rock.Model.AttributeValueService.Get方法的典型用法代码示例。如果您正苦于以下问题:C# AttributeValueService.Get方法的具体用法?C# AttributeValueService.Get怎么用?C# AttributeValueService.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.AttributeValueService
的用法示例。
在下文中一共展示了AttributeValueService.Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: lvAttributeValues_ItemUpdating
void lvAttributeValues_ItemUpdating( object sender, ListViewUpdateEventArgs e )
{
PlaceHolder phEditValue = lvAttributeValues.EditItem.FindControl( "phEditValue" ) as PlaceHolder;
if ( phEditValue != null && phEditValue.Controls.Count == 1 )
{
string value = _attribute.FieldType.Field.GetEditValue( phEditValue.Controls[0], _attribute.QualifierValues );
var attributeValueService = new AttributeValueService();
var attributeValue = attributeValueService.Get( ( int )e.Keys["Id"] );
if ( attributeValue == null )
{
attributeValue = new AttributeValue();
attributeValueService.Add( attributeValue, _currentPersonId );
attributeValue.AttributeId = _attribute.Id;
attributeValue.EntityId = _model.Id;
}
attributeValue.Value = value;
attributeValueService.Save( attributeValue, _currentPersonId );
_model.LoadAttributes();
}
lvAttributeValues.EditIndex = -1;
BindData();
}
示例2: lvAttributeValues_ItemDeleting
void lvAttributeValues_ItemDeleting( object sender, ListViewDeleteEventArgs e )
{
var attributeValueService = new AttributeValueService();
var attributeValue = attributeValueService.Get( ( int )e.Keys["Id"] );
if ( attributeValue != null )
{
attributeValueService.Delete( attributeValue, _currentPersonId );
attributeValueService.Save( attributeValue, _currentPersonId );
_model.LoadAttributes();
}
BindData();
}