public virtual void Save() { foreach (IPicklistItemState s in this.LoadedPicklistItemStates) { PicklistItemStateDao.Save(s); } foreach (IPicklistItemState s in this._removedPicklistItemStates.Values) { PicklistItemStateDao.Delete(s); } }
public virtual IPicklistItemState Get(PicklistItemOrderShipGrpInvId picklistItemOrderShipGrpInvId, bool forCreation, bool nullAllowed) { PicklistBinPicklistItemId globalId = new PicklistBinPicklistItemId(_picklistBinState.PicklistBinId, picklistItemOrderShipGrpInvId); if (_loadedPicklistItemStates.ContainsKey(globalId)) { var state = _loadedPicklistItemStates[globalId]; if (this._picklistBinState != null && this._picklistBinState.ReadOnly == false) { ((IPicklistItemState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new PicklistItemState(ForReapplying); state.PicklistBinPicklistItemId = globalId; _loadedPicklistItemStates.Add(globalId, state); if (this._picklistBinState != null && this._picklistBinState.ReadOnly == false) { ((IPicklistItemState)state).ReadOnly = false; } return(state); } else { var state = PicklistItemStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedPicklistItemStates.Add(globalId, state); } if (this._picklistBinState != null && this._picklistBinState.ReadOnly == false) { ((IPicklistItemState)state).ReadOnly = false; } return(state); } }