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); }
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); } }
public static CreateShipmentReceiptImage ToCreateShipmentReceiptImage(this ShipmentReceiptImageState state) { return(state.ToCreateShipmentReceiptImage <CreateShipmentReceiptImage>()); }
public static MergePatchShipmentReceiptImage ToMergePatchShipmentReceiptImage(this ShipmentReceiptImageState state) { return(state.ToMergePatchShipmentReceiptImage <MergePatchShipmentReceiptImage>()); }
public static RemoveShipmentReceiptImage ToRemoveShipmentReceiptImage(this ShipmentReceiptImageState state) { return(state.ToRemoveShipmentReceiptImage <RemoveShipmentReceiptImage>()); }
public static IShipmentReceiptImageCommand ToCreateOrMergePatchShipmentReceiptImage(this ShipmentReceiptImageState state) { return(state.ToCreateOrMergePatchShipmentReceiptImage <CreateShipmentReceiptImage, MergePatchShipmentReceiptImage>()); }