예제 #1
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            OrderItemShipGroupAssociationId other = obj as OrderItemShipGroupAssociationId;

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

            return(true &&
                   Object.Equals(this.OrderId, other.OrderId) &&
                   Object.Equals(this.OrderShipGroupShipGroupSeqId, other.OrderShipGroupShipGroupSeqId) &&
                   Object.Equals(this.OrderItemSeqId, other.OrderItemSeqId)
                   );
        }
예제 #2
0
        public virtual IOrderItemShipGroupAssociationState Get(string orderItemSeqId, bool forCreation, bool nullAllowed)
        {
            OrderItemShipGroupAssociationId globalId = new OrderItemShipGroupAssociationId((_orderShipGroupState as IGlobalIdentity <OrderShipGroupId>).GlobalId.OrderId, (_orderShipGroupState as IGlobalIdentity <OrderShipGroupId>).GlobalId.ShipGroupSeqId, orderItemSeqId);

            if (_loadedOrderItemShipGroupAssociationStates.ContainsKey(globalId))
            {
                var state = _loadedOrderItemShipGroupAssociationStates[globalId];
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new OrderItemShipGroupAssociationState(ForReapplying);
                state.OrderItemShipGroupAssociationId = globalId;
                _loadedOrderItemShipGroupAssociationStates.Add(globalId, state);
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = OrderItemShipGroupAssociationStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedOrderItemShipGroupAssociationStates.Add(globalId, state);
                }
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
        }