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

            ShipmentReceiptImageId other = obj as ShipmentReceiptImageId;

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

            return(true &&
                   Object.Equals(this.ShipmentId, other.ShipmentId) &&
                   Object.Equals(this.ShipmentReceiptReceiptSeqId, other.ShipmentReceiptReceiptSeqId) &&
                   Object.Equals(this.SequenceId, other.SequenceId)
                   );
        }
Beispiel #2
0
        public virtual IShipmentReceiptImageState Get(string sequenceId, bool forCreation, bool nullAllowed)
        {
            ShipmentReceiptImageId globalId = new ShipmentReceiptImageId((_shipmentReceiptState as IGlobalIdentity <ShipmentReceiptId>).GlobalId.ShipmentId, (_shipmentReceiptState as IGlobalIdentity <ShipmentReceiptId>).GlobalId.ReceiptSeqId, sequenceId);

            if (_loadedShipmentReceiptImageStates.ContainsKey(globalId))
            {
                var state = _loadedShipmentReceiptImageStates[globalId];
                if (this._shipmentReceiptState != null && this._shipmentReceiptState.ReadOnly == false)
                {
                    ((IShipmentReceiptImageState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new ShipmentReceiptImageState(ForReapplying);
                state.ShipmentReceiptImageId = globalId;
                _loadedShipmentReceiptImageStates.Add(globalId, state);
                if (this._shipmentReceiptState != null && this._shipmentReceiptState.ReadOnly == false)
                {
                    ((IShipmentReceiptImageState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = ShipmentReceiptImageStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedShipmentReceiptImageStates.Add(globalId, state);
                }
                if (this._shipmentReceiptState != null && this._shipmentReceiptState.ReadOnly == false)
                {
                    ((IShipmentReceiptImageState)state).ReadOnly = false;
                }
                return(state);
            }
        }