public virtual IInOutLineState Get(long lineNumber, bool forCreation, bool nullAllowed) { InOutLineId globalId = new InOutLineId(_inOutState.DocumentNumber, lineNumber); if (_loadedInOutLineStates.ContainsKey(globalId)) { return(_loadedInOutLineStates[globalId]); } if (forCreation || ForReapplying) { var state = new InOutLineState(ForReapplying); state.InOutLineId = globalId; _loadedInOutLineStates.Add(globalId, state); return(state); } else { var state = InOutLineStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedInOutLineStates.Add(globalId, state); } return(state); } }
public virtual IInOutLineState ToInOutLineState() { var state = new InOutLineState(true); state.LineNumber = this.LineNumber; state.LocatorId = this.LocatorId; state.ProductId = this.ProductId; state.AttributeSetInstanceId = this.AttributeSetInstanceId; state.Description = this.Description; state.QuantityUomId = this.QuantityUomId; if (this.MovementQuantity != null && this.MovementQuantity.HasValue) { state.MovementQuantity = this.MovementQuantity.Value; } if (this.PickedQuantity != null && this.PickedQuantity.HasValue) { state.PickedQuantity = this.PickedQuantity.Value; } if (this.IsInvoiced != null && this.IsInvoiced.HasValue) { state.IsInvoiced = this.IsInvoiced.Value; } if (this.Processed != null && this.Processed.HasValue) { state.Processed = this.Processed.Value; } state.RmaLineNumber = this.RmaLineNumber; state.ReversalLineNumber = this.ReversalLineNumber; 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.InOutDocumentNumber = this.InOutDocumentNumber; 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 static CreateInOutLine ToCreateInOutLine(this InOutLineState state) { return(state.ToCreateInOutLine <CreateInOutLine>()); }
public static MergePatchInOutLine ToMergePatchInOutLine(this InOutLineState state) { return(state.ToMergePatchInOutLine <MergePatchInOutLine>()); }
public static RemoveInOutLine ToRemoveInOutLine(this InOutLineState state) { return(state.ToRemoveInOutLine <RemoveInOutLine>()); }
public static IInOutLineCommand ToCreateOrMergePatchInOutLine(this InOutLineState state) { return(state.ToCreateOrMergePatchInOutLine <CreateInOutLine, MergePatchInOutLine>()); }
public static MergePatchInOutLine ToMergePatchInOutLine(this InOutLineState state) { return(state.ToMergePatchInOutLine <MergePatchInOutLine, CreateInOutLineImage, MergePatchInOutLineImage>()); }