Ejemplo n.º 1
0
        public virtual IShipmentReceiptImageState ToShipmentReceiptImageState()
        {
            var state = new ShipmentReceiptImageState(true);

            state.SequenceId = this.SequenceId;
            state.Url        = this.Url;
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.ShipmentId = this.ShipmentId;
            state.ShipmentReceiptReceiptSeqId = this.ShipmentReceiptReceiptSeqId;
            state.CreatedBy = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }

            return(state);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 public static CreateShipmentReceiptImage ToCreateShipmentReceiptImage(this ShipmentReceiptImageState state)
 {
     return(state.ToCreateShipmentReceiptImage <CreateShipmentReceiptImage>());
 }
Ejemplo n.º 4
0
 public static MergePatchShipmentReceiptImage ToMergePatchShipmentReceiptImage(this ShipmentReceiptImageState state)
 {
     return(state.ToMergePatchShipmentReceiptImage <MergePatchShipmentReceiptImage>());
 }
Ejemplo n.º 5
0
 public static RemoveShipmentReceiptImage ToRemoveShipmentReceiptImage(this ShipmentReceiptImageState state)
 {
     return(state.ToRemoveShipmentReceiptImage <RemoveShipmentReceiptImage>());
 }
Ejemplo n.º 6
0
 public static IShipmentReceiptImageCommand ToCreateOrMergePatchShipmentReceiptImage(this ShipmentReceiptImageState state)
 {
     return(state.ToCreateOrMergePatchShipmentReceiptImage <CreateShipmentReceiptImage, MergePatchShipmentReceiptImage>());
 }