public virtual IOrderItemShipGroupAssociationState ToOrderItemShipGroupAssociationState()
        {
            var state = new OrderItemShipGroupAssociationState(true);

            state.OrderItemSeqId = this.OrderItemSeqId;
            state.Quantity       = this.Quantity;
            state.CancelQuantity = this.CancelQuantity;
            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.OrderId = this.OrderId;
            state.OrderShipGroupShipGroupSeqId = this.OrderShipGroupShipGroupSeqId;
            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);
        }
Пример #2
0
        public virtual IOrderItemShipGroupAssociationState Get(string orderItemSeqId, bool forCreation, bool nullAllowed)
        {
            OrderItemShipGroupAssociationId globalId = new OrderItemShipGroupAssociationId((_orderShipGroupState as IGlobalIdentity <OrderShipGroupId>).GlobalId.OrderId, (_orderShipGroupState as IGlobalIdentity <OrderShipGroupId>).GlobalId.ShipGroupSeqId, orderItemSeqId);

            if (_loadedOrderItemShipGroupAssociationStates.ContainsKey(globalId))
            {
                var state = _loadedOrderItemShipGroupAssociationStates[globalId];
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new OrderItemShipGroupAssociationState(ForReapplying);
                state.OrderItemShipGroupAssociationId = globalId;
                _loadedOrderItemShipGroupAssociationStates.Add(globalId, state);
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = OrderItemShipGroupAssociationStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedOrderItemShipGroupAssociationStates.Add(globalId, state);
                }
                if (this._orderShipGroupState != null && this._orderShipGroupState.ReadOnly == false)
                {
                    ((IOrderItemShipGroupAssociationState)state).ReadOnly = false;
                }
                return(state);
            }
        }
 public static CreateOrderItemShipGroupAssociation ToCreateOrderItemShipGroupAssociation(this OrderItemShipGroupAssociationState state)
 {
     return(state.ToCreateOrderItemShipGroupAssociation <CreateOrderItemShipGroupAssociation>());
 }
 public static MergePatchOrderItemShipGroupAssociation ToMergePatchOrderItemShipGroupAssociation(this OrderItemShipGroupAssociationState state)
 {
     return(state.ToMergePatchOrderItemShipGroupAssociation <MergePatchOrderItemShipGroupAssociation>());
 }
 public static RemoveOrderItemShipGroupAssociation ToRemoveOrderItemShipGroupAssociation(this OrderItemShipGroupAssociationState state)
 {
     return(state.ToRemoveOrderItemShipGroupAssociation <RemoveOrderItemShipGroupAssociation>());
 }
 public static IOrderItemShipGroupAssociationCommand ToCreateOrMergePatchOrderItemShipGroupAssociation(this OrderItemShipGroupAssociationState state)
 {
     return(state.ToCreateOrMergePatchOrderItemShipGroupAssociation <CreateOrderItemShipGroupAssociation, MergePatchOrderItemShipGroupAssociation>());
 }