示例#1
0
        public virtual IAttributeUseState Get(string attributeId, bool forCreation, bool nullAllowed)
        {
            AttributeSetAttributeUseId globalId = new AttributeSetAttributeUseId(_attributeSetState.AttributeSetId, attributeId);

            if (_loadedAttributeUseStates.ContainsKey(globalId))
            {
                return(_loadedAttributeUseStates[globalId]);
            }
            if (forCreation || ForReapplying)
            {
                var state = new AttributeUseState(ForReapplying);
                state.AttributeSetAttributeUseId = globalId;
                _loadedAttributeUseStates.Add(globalId, state);
                return(state);
            }
            else
            {
                var state = AttributeUseStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedAttributeUseStates.Add(globalId, state);
                }
                return(state);
            }
        }
示例#2
0
 public virtual void Save()
 {
     foreach (IAttributeUseState s in this.LoadedAttributeUseStates)
     {
         AttributeUseStateDao.Save(s);
     }
     foreach (IAttributeUseState s in this._removedAttributeUseStates.Values)
     {
         AttributeUseStateDao.Delete(s);
     }
 }
示例#3
0
        public virtual IAttributeUseState Get(string attributeId)
        {
            AttributeSetAttributeUseId globalId = new AttributeSetAttributeUseId(_attributeSetState.AttributeSetId, attributeId);

            if (_loadedAttributeUseStates.ContainsKey(globalId))
            {
                return(_loadedAttributeUseStates[globalId]);
            }
            var state = AttributeUseStateDao.Get(globalId);

            _loadedAttributeUseStates.Add(globalId, state);
            return(state);
        }