コード例 #1
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            PicklistBinPicklistItemId other = obj as PicklistBinPicklistItemId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.PicklistBinId, other.PicklistBinId) &&
                   Object.Equals(this.PicklistItemOrderShipGrpInvId, other.PicklistItemOrderShipGrpInvId)
                   );
        }
コード例 #2
0
        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);
            }
        }