public virtual IShipmentItemState ToShipmentItemState() { var state = new ShipmentItemState(true); state.ShipmentItemSeqId = this.ShipmentItemSeqId; state.ProductId = this.ProductId; state.AttributeSetInstanceId = this.AttributeSetInstanceId; state.Quantity = this.Quantity; state.ShipmentContentDescription = this.ShipmentContentDescription; 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.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 IShipmentItemState Get(string shipmentItemSeqId, bool forCreation, bool nullAllowed) { ShipmentItemId globalId = new ShipmentItemId(_shipmentState.ShipmentId, shipmentItemSeqId); if (_loadedShipmentItemStates.ContainsKey(globalId)) { var state = _loadedShipmentItemStates[globalId]; if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IShipmentItemState)state).ReadOnly = false; } return(state); } if (forCreation || ForReapplying) { var state = new ShipmentItemState(ForReapplying); state.ShipmentItemId = globalId; _loadedShipmentItemStates.Add(globalId, state); if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IShipmentItemState)state).ReadOnly = false; } return(state); } else { var state = ShipmentItemStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedShipmentItemStates.Add(globalId, state); } if (this._shipmentState != null && this._shipmentState.ReadOnly == false) { ((IShipmentItemState)state).ReadOnly = false; } return(state); } }
public static CreateShipmentItem ToCreateShipmentItem(this ShipmentItemState state) { return(state.ToCreateShipmentItem <CreateShipmentItem>()); }
public static MergePatchShipmentItem ToMergePatchShipmentItem(this ShipmentItemState state) { return(state.ToMergePatchShipmentItem <MergePatchShipmentItem>()); }
public static RemoveShipmentItem ToRemoveShipmentItem(this ShipmentItemState state) { return(state.ToRemoveShipmentItem <RemoveShipmentItem>()); }
public static IShipmentItemCommand ToCreateOrMergePatchShipmentItem(this ShipmentItemState state) { return(state.ToCreateOrMergePatchShipmentItem <CreateShipmentItem, MergePatchShipmentItem>()); }