protected int _setValue(decimal AttributeKey, CRdsAttributeValues Value)
        {
            var R = this._getValue(Value.AttributeKey);
            if (R != null)
                this._values.Remove(AttributeKey);
            this._values.Add(AttributeKey, Value);

            return -1;
        }
        public static CRdsAttributeValues sGetValues(decimal ElementVersion, decimal AttributeKey, DataContext Context)
        {
            var Values = CRdsAttributeValue.sGetAttributeValues(ElementVersion, AttributeKey, Context);
            CRdsAttributeValues R = new CRdsAttributeValues()
            {
                AttributeKey = AttributeKey,
                ElementVersion = ElementVersion,
                Context = Context
            };
            foreach (CRdsAttributeValue Value in Values)
                R.Values.Add(Value.AttributeLocale, Value);

            return R;
        }
        public static List<CRdsAttributeValues> sGetValuesByElementVersion(decimal ElementVersion, DataContext Context)
        {
            List<CRdsAttributeValues> R = new List<CRdsAttributeValues>();

            var Values = CRdsAttributeValue.sGetAttributeValuesByElement(ElementVersion, Context);
            decimal AttrKey, PrevAttrKey;
            PrevAttrKey = -1;
            AttrKey = -1;

            CRdsAttributeValues CurrentValue = null;

            foreach (CRdsAttributeValue Value in Values)
            {
                AttrKey = Value.AttributeKey;
                if (AttrKey != PrevAttrKey)
                {
                    if (CurrentValue != null)
                        R.Add(CurrentValue);
                    CurrentValue = new CRdsAttributeValues()
                    {
                        AttributeKey = AttrKey,
                        Context = Context,
                        ElementVersion = Value.ElementVersion
                    };
                }
                else
                    CurrentValue.Values.Add(Value.AttributeLocale, Value);
            }

            return R;
        }
        protected int _setValue(decimal AttributeKey, int LanguageCode, object Value)
        {
            var R = this._getValue(AttributeKey);
            if (R == null)
            {
                R = new CRdsAttributeValues()
                {
                    AttributeKey = AttributeKey,
                    ElementVersion = this._elementVersion,
                    Context = this._context
                };                
                this._values.Add(AttributeKey, R);
            }

            R[LanguageCode].AttributeValue = Value;

            return -1;
        }
Beispiel #5
0
 protected int _setValue(decimal AttributeKey, CRdsAttributeValues Value)
 {
     this._values[AttributeKey] = Value;
     return -1;
 }