Exemple #1
0
        protected virtual IInOutLineStateCreated MapCreate(ICreateInOutLine c, IInOutCommand outerCommand, long version, IInOutState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId         = new InOutLineEventId(c.InOutDocumentNumber, c.LineNumber, version);
            IInOutLineStateCreated e = NewInOutLineStateCreated(stateEventId);
            var s = outerState.InOutLines.Get(c.LineNumber, true);

            e.LocatorId = c.LocatorId;
            e.ProductId = c.ProductId;
            e.AttributeSetInstanceId = c.AttributeSetInstanceId;
            e.DamageStatusIds        = c.DamageStatusIds;
            e.Description            = c.Description;
            e.QuantityUomId          = c.QuantityUomId;
            e.MovementQuantity       = c.MovementQuantity;
            e.PickedQuantity         = c.PickedQuantity;
            e.IsInvoiced             = c.IsInvoiced;
            e.Processed          = c.Processed;
            e.RmaLineNumber      = c.RmaLineNumber;
            e.ReversalLineNumber = c.ReversalLineNumber;
            e.Active             = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            foreach (ICreateInOutLineImage innerCommand in c.InOutLineImages)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IInOutLineImageStateCreated innerEvent = MapCreate(innerCommand, c, version, s);
                e.AddInOutLineImageEvent(innerEvent);
            }

            return(e);
        }// END Map(ICreate... ////////////////////////////
Exemple #2
0
        private InOutLineEventId NewInOutLineEventId(string lineNumber)
        {
            var eId = new InOutLineEventId();

            eId.InOutDocumentNumber = this.InOutEventId.DocumentNumber;
            eId.LineNumber          = lineNumber;
            eId.InOutVersion        = this.InOutEventId.Version;
            return(eId);
        }
Exemple #3
0
        }// END Map(IMergePatch... ////////////////////////////

        protected virtual IInOutLineStateRemoved MapRemove(IRemoveInOutLine c, IInOutCommand outerCommand, long version)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId         = new InOutLineEventId(c.InOutDocumentNumber, c.LineNumber, version);
            IInOutLineStateRemoved e = NewInOutLineStateRemoved(stateEventId);


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            return(e);
        }// END Map(IRemove... ////////////////////////////
Exemple #4
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            InOutLineEventId other = obj as InOutLineEventId;

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

            return(true &&
                   Object.Equals(this.InOutDocumentNumber, other.InOutDocumentNumber) &&
                   Object.Equals(this.LineNumber, other.LineNumber) &&
                   Object.Equals(this.InOutVersion, other.InOutVersion)
                   );
        }
Exemple #5
0
        }// END Map(ICreate... ////////////////////////////

        protected virtual IInOutLineStateMergePatched MapMergePatch(IMergePatchInOutLine c, IInOutCommand outerCommand, long version, IInOutState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new InOutLineEventId(c.InOutDocumentNumber, c.LineNumber, version);
            IInOutLineStateMergePatched e = NewInOutLineStateMergePatched(stateEventId);
            var s = outerState.InOutLines.Get(c.LineNumber);

            e.LocatorId = c.LocatorId;
            e.ProductId = c.ProductId;
            e.AttributeSetInstanceId = c.AttributeSetInstanceId;
            e.Description            = c.Description;
            e.QuantityUomId          = c.QuantityUomId;
            e.MovementQuantity       = c.MovementQuantity;
            e.PickedQuantity         = c.PickedQuantity;
            e.IsInvoiced             = c.IsInvoiced;
            e.Processed                  = c.Processed;
            e.RmaLineNumber              = c.RmaLineNumber;
            e.ReversalLineNumber         = c.ReversalLineNumber;
            e.Active                     = c.Active;
            e.IsPropertyLocatorIdRemoved = c.IsPropertyLocatorIdRemoved;
            e.IsPropertyProductIdRemoved = c.IsPropertyProductIdRemoved;
            e.IsPropertyAttributeSetInstanceIdRemoved = c.IsPropertyAttributeSetInstanceIdRemoved;
            e.IsPropertyDescriptionRemoved            = c.IsPropertyDescriptionRemoved;
            e.IsPropertyQuantityUomIdRemoved          = c.IsPropertyQuantityUomIdRemoved;
            e.IsPropertyMovementQuantityRemoved       = c.IsPropertyMovementQuantityRemoved;
            e.IsPropertyPickedQuantityRemoved         = c.IsPropertyPickedQuantityRemoved;
            e.IsPropertyIsInvoicedRemoved             = c.IsPropertyIsInvoicedRemoved;
            e.IsPropertyProcessedRemoved          = c.IsPropertyProcessedRemoved;
            e.IsPropertyRmaLineNumberRemoved      = c.IsPropertyRmaLineNumberRemoved;
            e.IsPropertyReversalLineNumberRemoved = c.IsPropertyReversalLineNumberRemoved;
            e.IsPropertyActiveRemoved             = c.IsPropertyActiveRemoved;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(IMergePatch... ////////////////////////////
 protected InOutLineStateEventDtoBase(InOutLineEventId stateEventId)
 {
     this.InOutLineEventId = stateEventId;
 }
Exemple #7
0
 public InOutLineStateRemoved(InOutLineEventId stateEventId) : base(stateEventId)
 {
 }
Exemple #8
0
 public InOutLineStateMergePatched(InOutLineEventId stateEventId) : base(stateEventId)
 {
 }
Exemple #9
0
 public InOutLineStateCreated(InOutLineEventId stateEventId) : base(stateEventId)
 {
 }
Exemple #10
0
 protected InOutLineStateEventBase(InOutLineEventId stateEventId) : base(stateEventId)
 {
 }
Exemple #11
0
 private InOutLineStateRemoved NewInOutLineStateRemoved(InOutLineEventId stateEventId)
 {
     return(new InOutLineStateRemoved(stateEventId));
 }
Exemple #12
0
 private InOutLineStateMergePatched NewInOutLineStateMergePatched(InOutLineEventId stateEventId)
 {
     return(new InOutLineStateMergePatched(stateEventId));
 }
Exemple #13
0
        protected InOutLineEventId NewInOutLineEventId(string lineNumber)
        {
            var stateEventId = new InOutLineEventId(this.InOutEventId.DocumentNumber, lineNumber, this.InOutEventId.Version);

            return(stateEventId);
        }