Esempio n. 1
0
        public virtual void Initialize(IOrderRoleMvoStateCreated stateCreated)
        {
            var aggregateId = stateCreated.OrderRoleMvoEventId.OrderRoleId;
            var state       = new OrderRoleMvoState();

            state.OrderRoleId = aggregateId;
            var aggregate = (OrderRoleMvoAggregate)GetOrderRoleMvoAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
Esempio n. 2
0
 public static CreateOrderRoleMvo ToCreateOrderRoleMvo(this OrderRoleMvoState state)
 {
     return(state.ToCreateOrderRoleMvo <CreateOrderRoleMvo>());
 }
Esempio n. 3
0
 public static MergePatchOrderRoleMvo ToMergePatchOrderRoleMvo(this OrderRoleMvoState state)
 {
     return(state.ToMergePatchOrderRoleMvo <MergePatchOrderRoleMvo>());
 }
Esempio n. 4
0
 public static DeleteOrderRoleMvo ToDeleteOrderRoleMvo(this OrderRoleMvoState state)
 {
     return(state.ToDeleteOrderRoleMvo <DeleteOrderRoleMvo>());
 }
Esempio n. 5
0
 public static IOrderRoleMvoCommand ToCreateOrMergePatchOrderRoleMvo(this OrderRoleMvoState state)
 {
     return(state.ToCreateOrMergePatchOrderRoleMvo <CreateOrderRoleMvo, MergePatchOrderRoleMvo>());
 }
Esempio n. 6
0
        public virtual IOrderRoleMvoState ToOrderRoleMvoState()
        {
            var state = new OrderRoleMvoState(true);

            state.OrderRoleId = this.OrderRoleId;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            state.OrderOrderTypeId             = this.OrderOrderTypeId;
            state.OrderOrderName               = this.OrderOrderName;
            state.OrderExternalId              = this.OrderExternalId;
            state.OrderSalesChannelEnumId      = this.OrderSalesChannelEnumId;
            state.OrderOrderDate               = this.OrderOrderDate;
            state.OrderPriority                = this.OrderPriority;
            state.OrderEntryDate               = this.OrderEntryDate;
            state.OrderPickSheetPrintedDate    = this.OrderPickSheetPrintedDate;
            state.OrderStatusId                = this.OrderStatusId;
            state.OrderCurrencyUom             = this.OrderCurrencyUom;
            state.OrderSyncStatusId            = this.OrderSyncStatusId;
            state.OrderBillingAccountId        = this.OrderBillingAccountId;
            state.OrderOriginFacilityId        = this.OrderOriginFacilityId;
            state.OrderWebSiteId               = this.OrderWebSiteId;
            state.OrderProductStoreId          = this.OrderProductStoreId;
            state.OrderTerminalId              = this.OrderTerminalId;
            state.OrderTransactionId           = this.OrderTransactionId;
            state.OrderAutoOrderShoppingListId = this.OrderAutoOrderShoppingListId;
            state.OrderNeedsInventoryIssuance  = this.OrderNeedsInventoryIssuance;
            state.OrderIsRushOrder             = this.OrderIsRushOrder;
            state.OrderInternalCode            = this.OrderInternalCode;
            state.OrderRemainingSubTotal       = this.OrderRemainingSubTotal;
            state.OrderGrandTotal              = this.OrderGrandTotal;
            state.OrderInvoicePerShipment      = this.OrderInvoicePerShipment;
            state.OrderCreatedBy               = this.OrderCreatedBy;
            if (this.OrderCreatedAt != null && this.OrderCreatedAt.HasValue)
            {
                state.OrderCreatedAt = this.OrderCreatedAt.Value;
            }
            state.OrderUpdatedBy = this.OrderUpdatedBy;
            if (this.OrderUpdatedAt != null && this.OrderUpdatedAt.HasValue)
            {
                state.OrderUpdatedAt = this.OrderUpdatedAt.Value;
            }
            if (this.OrderActive != null && this.OrderActive.HasValue)
            {
                state.OrderActive = this.OrderActive.Value;
            }
            if (this.OrderVersion != null && this.OrderVersion.HasValue)
            {
                state.OrderVersion = this.OrderVersion.Value;
            }
            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);
        }