Пример #1
0
        public virtual IOrderShipGroupState ToOrderShipGroupState()
        {
            var state = new OrderShipGroupState(true);

            state.ShipGroupSeqId       = this.ShipGroupSeqId;
            state.ShipmentMethodTypeId = this.ShipmentMethodTypeId;
            state.SupplierPartyId      = this.SupplierPartyId;
            state.VendorPartyId        = this.VendorPartyId;
            state.CarrierPartyId       = this.CarrierPartyId;
            state.CarrierRoleTypeId    = this.CarrierRoleTypeId;
            state.FacilityId           = this.FacilityId;
            state.ContactMechId        = this.ContactMechId;
            state.TelecomContactMechId = this.TelecomContactMechId;
            state.TrackingNumber       = this.TrackingNumber;
            state.ShippingInstructions = this.ShippingInstructions;
            state.MaySplit             = this.MaySplit;
            state.GiftMessage          = this.GiftMessage;
            state.IsGift                = this.IsGift;
            state.ShipAfterDate         = this.ShipAfterDate;
            state.ShipByDate            = this.ShipByDate;
            state.EstimatedShipDate     = this.EstimatedShipDate;
            state.EstimatedDeliveryDate = this.EstimatedDeliveryDate;
            state.PickwaveId            = this.PickwaveId;
            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.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;
            }
            if (this.OrderItemShipGroupAssociations != null)
            {
                foreach (var s in this.OrderItemShipGroupAssociations)
                {
                    state.OrderItemShipGroupAssociations.AddToSave(s.ToOrderItemShipGroupAssociationState());
                }
            }
            ;

            return(state);
        }
Пример #2
0
        public virtual IOrderShipGroupState Get(long?shipGroupSeqId, bool forCreation, bool nullAllowed)
        {
            OrderShipGroupId globalId = new OrderShipGroupId(_orderState.OrderId, shipGroupSeqId);

            if (_loadedOrderShipGroupStates.ContainsKey(globalId))
            {
                var state = _loadedOrderShipGroupStates[globalId];
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderShipGroupState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new OrderShipGroupState(ForReapplying);
                state.OrderShipGroupId = globalId;
                _loadedOrderShipGroupStates.Add(globalId, state);
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderShipGroupState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = OrderShipGroupStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedOrderShipGroupStates.Add(globalId, state);
                }
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderShipGroupState)state).ReadOnly = false;
                }
                return(state);
            }
        }
Пример #3
0
 public static CreateOrderShipGroup ToCreateOrderShipGroup(this OrderShipGroupState state)
 {
     return(state.ToCreateOrderShipGroup <CreateOrderShipGroup, CreateOrderItemShipGroupAssociation>());
 }
Пример #4
0
 public static MergePatchOrderShipGroup ToMergePatchOrderShipGroup(this OrderShipGroupState state)
 {
     return(state.ToMergePatchOrderShipGroup <MergePatchOrderShipGroup, CreateOrderItemShipGroupAssociation, MergePatchOrderItemShipGroupAssociation>());
 }
Пример #5
0
 public static RemoveOrderShipGroup ToRemoveOrderShipGroup(this OrderShipGroupState state)
 {
     return(state.ToRemoveOrderShipGroup <RemoveOrderShipGroup>());
 }
Пример #6
0
 public static IOrderShipGroupCommand ToCreateOrMergePatchOrderShipGroup(this OrderShipGroupState state)
 {
     return(state.ToCreateOrMergePatchOrderShipGroup <CreateOrderShipGroup, MergePatchOrderShipGroup, CreateOrderItemShipGroupAssociation, MergePatchOrderItemShipGroupAssociation>());
 }