public virtual void MergePatch(IMergePatchPhysicalInventoryLineMvo c) { IPhysicalInventoryLineMvoStateMergePatched e = Map(c); Apply(e); }
protected virtual IPhysicalInventoryLineMvoStateMergePatched Map(IMergePatchPhysicalInventoryLineMvo c) { var stateEventId = new PhysicalInventoryLineMvoEventId(c.PhysicalInventoryLineId, c.PhysicalInventoryVersion); IPhysicalInventoryLineMvoStateMergePatched e = NewPhysicalInventoryLineMvoStateMergePatched(stateEventId); e.BookQuantity = c.BookQuantity; e.CountedQuantity = c.CountedQuantity; e.Processed = c.Processed; e.LineNumber = c.LineNumber; e.ReversalLineNumber = c.ReversalLineNumber; e.Description = c.Description; e.Version = c.Version; e.PhysicalInventoryDocumentStatusId = c.PhysicalInventoryDocumentStatusId; e.PhysicalInventoryWarehouseId = c.PhysicalInventoryWarehouseId; e.PhysicalInventoryLocatorIdPattern = c.PhysicalInventoryLocatorIdPattern; e.PhysicalInventoryProductIdPattern = c.PhysicalInventoryProductIdPattern; e.PhysicalInventoryPosted = c.PhysicalInventoryPosted; e.PhysicalInventoryProcessed = c.PhysicalInventoryProcessed; e.PhysicalInventoryProcessing = c.PhysicalInventoryProcessing; e.PhysicalInventoryDocumentTypeId = c.PhysicalInventoryDocumentTypeId; e.PhysicalInventoryMovementDate = c.PhysicalInventoryMovementDate; e.PhysicalInventoryDescription = c.PhysicalInventoryDescription; e.PhysicalInventoryIsApproved = c.PhysicalInventoryIsApproved; e.PhysicalInventoryApprovalAmount = c.PhysicalInventoryApprovalAmount; e.PhysicalInventoryIsQuantityUpdated = c.PhysicalInventoryIsQuantityUpdated; e.PhysicalInventoryReversalDocumentNumber = c.PhysicalInventoryReversalDocumentNumber; e.PhysicalInventoryCreatedBy = c.PhysicalInventoryCreatedBy; e.PhysicalInventoryCreatedAt = c.PhysicalInventoryCreatedAt; e.PhysicalInventoryUpdatedBy = c.PhysicalInventoryUpdatedBy; e.PhysicalInventoryUpdatedAt = c.PhysicalInventoryUpdatedAt; e.PhysicalInventoryActive = c.PhysicalInventoryActive; e.IsPropertyBookQuantityRemoved = c.IsPropertyBookQuantityRemoved; e.IsPropertyCountedQuantityRemoved = c.IsPropertyCountedQuantityRemoved; e.IsPropertyProcessedRemoved = c.IsPropertyProcessedRemoved; e.IsPropertyLineNumberRemoved = c.IsPropertyLineNumberRemoved; e.IsPropertyReversalLineNumberRemoved = c.IsPropertyReversalLineNumberRemoved; e.IsPropertyDescriptionRemoved = c.IsPropertyDescriptionRemoved; e.IsPropertyVersionRemoved = c.IsPropertyVersionRemoved; e.IsPropertyPhysicalInventoryDocumentStatusIdRemoved = c.IsPropertyPhysicalInventoryDocumentStatusIdRemoved; e.IsPropertyPhysicalInventoryWarehouseIdRemoved = c.IsPropertyPhysicalInventoryWarehouseIdRemoved; e.IsPropertyPhysicalInventoryLocatorIdPatternRemoved = c.IsPropertyPhysicalInventoryLocatorIdPatternRemoved; e.IsPropertyPhysicalInventoryProductIdPatternRemoved = c.IsPropertyPhysicalInventoryProductIdPatternRemoved; e.IsPropertyPhysicalInventoryPostedRemoved = c.IsPropertyPhysicalInventoryPostedRemoved; e.IsPropertyPhysicalInventoryProcessedRemoved = c.IsPropertyPhysicalInventoryProcessedRemoved; e.IsPropertyPhysicalInventoryProcessingRemoved = c.IsPropertyPhysicalInventoryProcessingRemoved; e.IsPropertyPhysicalInventoryDocumentTypeIdRemoved = c.IsPropertyPhysicalInventoryDocumentTypeIdRemoved; e.IsPropertyPhysicalInventoryMovementDateRemoved = c.IsPropertyPhysicalInventoryMovementDateRemoved; e.IsPropertyPhysicalInventoryDescriptionRemoved = c.IsPropertyPhysicalInventoryDescriptionRemoved; e.IsPropertyPhysicalInventoryIsApprovedRemoved = c.IsPropertyPhysicalInventoryIsApprovedRemoved; e.IsPropertyPhysicalInventoryApprovalAmountRemoved = c.IsPropertyPhysicalInventoryApprovalAmountRemoved; e.IsPropertyPhysicalInventoryIsQuantityUpdatedRemoved = c.IsPropertyPhysicalInventoryIsQuantityUpdatedRemoved; e.IsPropertyPhysicalInventoryReversalDocumentNumberRemoved = c.IsPropertyPhysicalInventoryReversalDocumentNumberRemoved; e.IsPropertyPhysicalInventoryCreatedByRemoved = c.IsPropertyPhysicalInventoryCreatedByRemoved; e.IsPropertyPhysicalInventoryCreatedAtRemoved = c.IsPropertyPhysicalInventoryCreatedAtRemoved; e.IsPropertyPhysicalInventoryUpdatedByRemoved = c.IsPropertyPhysicalInventoryUpdatedByRemoved; e.IsPropertyPhysicalInventoryUpdatedAtRemoved = c.IsPropertyPhysicalInventoryUpdatedAtRemoved; e.IsPropertyPhysicalInventoryActiveRemoved = c.IsPropertyPhysicalInventoryActiveRemoved; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var physicalInventoryVersion = c.PhysicalInventoryVersion; return(e); }
public virtual void When(IPhysicalInventoryLineMvoStateMergePatched e) { ThrowOnWrongEvent(e); if (e.BookQuantity == null) { if (e.IsPropertyBookQuantityRemoved) { this.BookQuantity = default(decimal); } } else { this.BookQuantity = (e.BookQuantity != null && e.BookQuantity.HasValue) ? e.BookQuantity.Value : default(decimal); } if (e.CountedQuantity == null) { if (e.IsPropertyCountedQuantityRemoved) { this.CountedQuantity = default(decimal); } } else { this.CountedQuantity = (e.CountedQuantity != null && e.CountedQuantity.HasValue) ? e.CountedQuantity.Value : default(decimal); } if (e.Processed == null) { if (e.IsPropertyProcessedRemoved) { this.Processed = default(bool); } } else { this.Processed = (e.Processed != null && e.Processed.HasValue) ? e.Processed.Value : default(bool); } if (e.LineNumber == null) { if (e.IsPropertyLineNumberRemoved) { this.LineNumber = default(string); } } else { this.LineNumber = e.LineNumber; } if (e.ReversalLineNumber == null) { if (e.IsPropertyReversalLineNumberRemoved) { this.ReversalLineNumber = default(long); } } else { this.ReversalLineNumber = (e.ReversalLineNumber != null && e.ReversalLineNumber.HasValue) ? e.ReversalLineNumber.Value : default(long); } if (e.Description == null) { if (e.IsPropertyDescriptionRemoved) { this.Description = default(string); } } else { this.Description = e.Description; } if (e.Version == null) { if (e.IsPropertyVersionRemoved) { this.Version = default(long); } } else { this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long); } if (e.PhysicalInventoryDocumentStatusId == null) { if (e.IsPropertyPhysicalInventoryDocumentStatusIdRemoved) { this.PhysicalInventoryDocumentStatusId = default(string); } } else { this.PhysicalInventoryDocumentStatusId = e.PhysicalInventoryDocumentStatusId; } if (e.PhysicalInventoryWarehouseId == null) { if (e.IsPropertyPhysicalInventoryWarehouseIdRemoved) { this.PhysicalInventoryWarehouseId = default(string); } } else { this.PhysicalInventoryWarehouseId = e.PhysicalInventoryWarehouseId; } if (e.PhysicalInventoryLocatorIdPattern == null) { if (e.IsPropertyPhysicalInventoryLocatorIdPatternRemoved) { this.PhysicalInventoryLocatorIdPattern = default(string); } } else { this.PhysicalInventoryLocatorIdPattern = e.PhysicalInventoryLocatorIdPattern; } if (e.PhysicalInventoryProductIdPattern == null) { if (e.IsPropertyPhysicalInventoryProductIdPatternRemoved) { this.PhysicalInventoryProductIdPattern = default(string); } } else { this.PhysicalInventoryProductIdPattern = e.PhysicalInventoryProductIdPattern; } if (e.PhysicalInventoryPosted == null) { if (e.IsPropertyPhysicalInventoryPostedRemoved) { this.PhysicalInventoryPosted = default(bool); } } else { this.PhysicalInventoryPosted = (e.PhysicalInventoryPosted != null && e.PhysicalInventoryPosted.HasValue) ? e.PhysicalInventoryPosted.Value : default(bool); } if (e.PhysicalInventoryProcessed == null) { if (e.IsPropertyPhysicalInventoryProcessedRemoved) { this.PhysicalInventoryProcessed = default(bool); } } else { this.PhysicalInventoryProcessed = (e.PhysicalInventoryProcessed != null && e.PhysicalInventoryProcessed.HasValue) ? e.PhysicalInventoryProcessed.Value : default(bool); } if (e.PhysicalInventoryProcessing == null) { if (e.IsPropertyPhysicalInventoryProcessingRemoved) { this.PhysicalInventoryProcessing = default(string); } } else { this.PhysicalInventoryProcessing = e.PhysicalInventoryProcessing; } if (e.PhysicalInventoryDocumentTypeId == null) { if (e.IsPropertyPhysicalInventoryDocumentTypeIdRemoved) { this.PhysicalInventoryDocumentTypeId = default(string); } } else { this.PhysicalInventoryDocumentTypeId = e.PhysicalInventoryDocumentTypeId; } if (e.PhysicalInventoryMovementDate == null) { if (e.IsPropertyPhysicalInventoryMovementDateRemoved) { this.PhysicalInventoryMovementDate = default(DateTime?); } } else { this.PhysicalInventoryMovementDate = e.PhysicalInventoryMovementDate; } if (e.PhysicalInventoryDescription == null) { if (e.IsPropertyPhysicalInventoryDescriptionRemoved) { this.PhysicalInventoryDescription = default(string); } } else { this.PhysicalInventoryDescription = e.PhysicalInventoryDescription; } if (e.PhysicalInventoryIsApproved == null) { if (e.IsPropertyPhysicalInventoryIsApprovedRemoved) { this.PhysicalInventoryIsApproved = default(bool); } } else { this.PhysicalInventoryIsApproved = (e.PhysicalInventoryIsApproved != null && e.PhysicalInventoryIsApproved.HasValue) ? e.PhysicalInventoryIsApproved.Value : default(bool); } if (e.PhysicalInventoryApprovalAmount == null) { if (e.IsPropertyPhysicalInventoryApprovalAmountRemoved) { this.PhysicalInventoryApprovalAmount = default(decimal); } } else { this.PhysicalInventoryApprovalAmount = (e.PhysicalInventoryApprovalAmount != null && e.PhysicalInventoryApprovalAmount.HasValue) ? e.PhysicalInventoryApprovalAmount.Value : default(decimal); } if (e.PhysicalInventoryIsQuantityUpdated == null) { if (e.IsPropertyPhysicalInventoryIsQuantityUpdatedRemoved) { this.PhysicalInventoryIsQuantityUpdated = default(bool); } } else { this.PhysicalInventoryIsQuantityUpdated = (e.PhysicalInventoryIsQuantityUpdated != null && e.PhysicalInventoryIsQuantityUpdated.HasValue) ? e.PhysicalInventoryIsQuantityUpdated.Value : default(bool); } if (e.PhysicalInventoryReversalDocumentNumber == null) { if (e.IsPropertyPhysicalInventoryReversalDocumentNumberRemoved) { this.PhysicalInventoryReversalDocumentNumber = default(string); } } else { this.PhysicalInventoryReversalDocumentNumber = e.PhysicalInventoryReversalDocumentNumber; } if (e.PhysicalInventoryCreatedBy == null) { if (e.IsPropertyPhysicalInventoryCreatedByRemoved) { this.PhysicalInventoryCreatedBy = default(string); } } else { this.PhysicalInventoryCreatedBy = e.PhysicalInventoryCreatedBy; } if (e.PhysicalInventoryCreatedAt == null) { if (e.IsPropertyPhysicalInventoryCreatedAtRemoved) { this.PhysicalInventoryCreatedAt = default(DateTime); } } else { this.PhysicalInventoryCreatedAt = (e.PhysicalInventoryCreatedAt != null && e.PhysicalInventoryCreatedAt.HasValue) ? e.PhysicalInventoryCreatedAt.Value : default(DateTime); } if (e.PhysicalInventoryUpdatedBy == null) { if (e.IsPropertyPhysicalInventoryUpdatedByRemoved) { this.PhysicalInventoryUpdatedBy = default(string); } } else { this.PhysicalInventoryUpdatedBy = e.PhysicalInventoryUpdatedBy; } if (e.PhysicalInventoryUpdatedAt == null) { if (e.IsPropertyPhysicalInventoryUpdatedAtRemoved) { this.PhysicalInventoryUpdatedAt = default(DateTime); } } else { this.PhysicalInventoryUpdatedAt = (e.PhysicalInventoryUpdatedAt != null && e.PhysicalInventoryUpdatedAt.HasValue) ? e.PhysicalInventoryUpdatedAt.Value : default(DateTime); } if (e.PhysicalInventoryActive == null) { if (e.IsPropertyPhysicalInventoryActiveRemoved) { this.PhysicalInventoryActive = default(bool); } } else { this.PhysicalInventoryActive = (e.PhysicalInventoryActive != null && e.PhysicalInventoryActive.HasValue) ? e.PhysicalInventoryActive.Value : default(bool); } this.UpdatedBy = e.CreatedBy; this.UpdatedAt = e.CreatedAt; }
public virtual PhysicalInventoryLineMvoStateMergePatchedDto ToPhysicalInventoryLineMvoStateMergePatchedDto(IPhysicalInventoryLineMvoStateMergePatched e) { var dto = new PhysicalInventoryLineMvoStateMergePatchedDto(); dto.PhysicalInventoryLineMvoEventId = e.PhysicalInventoryLineMvoEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.CommandId = e.CommandId; dto.BookQuantity = e.BookQuantity; dto.CountedQuantity = e.CountedQuantity; dto.Processed = e.Processed; dto.LineNumber = e.LineNumber; dto.ReversalLineNumber = e.ReversalLineNumber; dto.Description = e.Description; dto.Version = e.Version; dto.PhysicalInventoryDocumentStatusId = e.PhysicalInventoryDocumentStatusId; dto.PhysicalInventoryWarehouseId = e.PhysicalInventoryWarehouseId; dto.PhysicalInventoryLocatorIdPattern = e.PhysicalInventoryLocatorIdPattern; dto.PhysicalInventoryProductIdPattern = e.PhysicalInventoryProductIdPattern; dto.PhysicalInventoryPosted = e.PhysicalInventoryPosted; dto.PhysicalInventoryProcessed = e.PhysicalInventoryProcessed; dto.PhysicalInventoryProcessing = e.PhysicalInventoryProcessing; dto.PhysicalInventoryDocumentTypeId = e.PhysicalInventoryDocumentTypeId; dto.PhysicalInventoryMovementDate = e.PhysicalInventoryMovementDate; dto.PhysicalInventoryDescription = e.PhysicalInventoryDescription; dto.PhysicalInventoryIsApproved = e.PhysicalInventoryIsApproved; dto.PhysicalInventoryApprovalAmount = e.PhysicalInventoryApprovalAmount; dto.PhysicalInventoryIsQuantityUpdated = e.PhysicalInventoryIsQuantityUpdated; dto.PhysicalInventoryReversalDocumentNumber = e.PhysicalInventoryReversalDocumentNumber; dto.PhysicalInventoryCreatedBy = e.PhysicalInventoryCreatedBy; dto.PhysicalInventoryCreatedAt = e.PhysicalInventoryCreatedAt; dto.PhysicalInventoryUpdatedBy = e.PhysicalInventoryUpdatedBy; dto.PhysicalInventoryUpdatedAt = e.PhysicalInventoryUpdatedAt; dto.PhysicalInventoryActive = e.PhysicalInventoryActive; dto.IsPropertyBookQuantityRemoved = e.IsPropertyBookQuantityRemoved; dto.IsPropertyCountedQuantityRemoved = e.IsPropertyCountedQuantityRemoved; dto.IsPropertyProcessedRemoved = e.IsPropertyProcessedRemoved; dto.IsPropertyLineNumberRemoved = e.IsPropertyLineNumberRemoved; dto.IsPropertyReversalLineNumberRemoved = e.IsPropertyReversalLineNumberRemoved; dto.IsPropertyDescriptionRemoved = e.IsPropertyDescriptionRemoved; dto.IsPropertyVersionRemoved = e.IsPropertyVersionRemoved; dto.IsPropertyPhysicalInventoryDocumentStatusIdRemoved = e.IsPropertyPhysicalInventoryDocumentStatusIdRemoved; dto.IsPropertyPhysicalInventoryWarehouseIdRemoved = e.IsPropertyPhysicalInventoryWarehouseIdRemoved; dto.IsPropertyPhysicalInventoryLocatorIdPatternRemoved = e.IsPropertyPhysicalInventoryLocatorIdPatternRemoved; dto.IsPropertyPhysicalInventoryProductIdPatternRemoved = e.IsPropertyPhysicalInventoryProductIdPatternRemoved; dto.IsPropertyPhysicalInventoryPostedRemoved = e.IsPropertyPhysicalInventoryPostedRemoved; dto.IsPropertyPhysicalInventoryProcessedRemoved = e.IsPropertyPhysicalInventoryProcessedRemoved; dto.IsPropertyPhysicalInventoryProcessingRemoved = e.IsPropertyPhysicalInventoryProcessingRemoved; dto.IsPropertyPhysicalInventoryDocumentTypeIdRemoved = e.IsPropertyPhysicalInventoryDocumentTypeIdRemoved; dto.IsPropertyPhysicalInventoryMovementDateRemoved = e.IsPropertyPhysicalInventoryMovementDateRemoved; dto.IsPropertyPhysicalInventoryDescriptionRemoved = e.IsPropertyPhysicalInventoryDescriptionRemoved; dto.IsPropertyPhysicalInventoryIsApprovedRemoved = e.IsPropertyPhysicalInventoryIsApprovedRemoved; dto.IsPropertyPhysicalInventoryApprovalAmountRemoved = e.IsPropertyPhysicalInventoryApprovalAmountRemoved; dto.IsPropertyPhysicalInventoryIsQuantityUpdatedRemoved = e.IsPropertyPhysicalInventoryIsQuantityUpdatedRemoved; dto.IsPropertyPhysicalInventoryReversalDocumentNumberRemoved = e.IsPropertyPhysicalInventoryReversalDocumentNumberRemoved; dto.IsPropertyPhysicalInventoryCreatedByRemoved = e.IsPropertyPhysicalInventoryCreatedByRemoved; dto.IsPropertyPhysicalInventoryCreatedAtRemoved = e.IsPropertyPhysicalInventoryCreatedAtRemoved; dto.IsPropertyPhysicalInventoryUpdatedByRemoved = e.IsPropertyPhysicalInventoryUpdatedByRemoved; dto.IsPropertyPhysicalInventoryUpdatedAtRemoved = e.IsPropertyPhysicalInventoryUpdatedAtRemoved; dto.IsPropertyPhysicalInventoryActiveRemoved = e.IsPropertyPhysicalInventoryActiveRemoved; return(dto); }
void IPhysicalInventoryLineMvoState.When(IPhysicalInventoryLineMvoStateMergePatched e) { throw new NotSupportedException(); }