public void UpdateProperty(IndicatorMetadataTextProperty property, string text, int indicatorId, int? profileId) { var groupMatch = profileId.HasValue ? "=" + profileId.Value : "IS NULL"; var queryString = string.Format( @"update IndicatorMetadataTextValue set {0} = :text where IndicatorID = {1} AND ProfileId {2}", property.ColumnName, indicatorId, groupMatch); var updateSession = CurrentSession.CreateQuery(queryString); updateSession.SetParameter("text", text); updateSession.ExecuteUpdate(); }
public void CreateNewOverriddenIndicator(IndicatorMetadataTextProperty property, string text, int indicatorId, int? profileId) { var indicatorMetaDataTextValue = new IndicatorMetadataTextValue() { IndicatorId = indicatorId, ProfileId = profileId, }; indicatorMetaDataTextValue.SetPropertyValue(property.ColumnName, text); CurrentSession.Save(indicatorMetaDataTextValue); }