Пример #1
0
        public virtual IItemIssuanceState ToItemIssuanceState()
        {
            var state = new ItemIssuanceState(true);

            state.ItemIssuanceSeqId      = this.ItemIssuanceSeqId;
            state.OrderId                = this.OrderId;
            state.OrderItemSeqId         = this.OrderItemSeqId;
            state.ShipGroupSeqId         = this.ShipGroupSeqId;
            state.ProductId              = this.ProductId;
            state.LocatorId              = this.LocatorId;
            state.AttributeSetInstanceId = this.AttributeSetInstanceId;
            state.ShipmentItemSeqId      = this.ShipmentItemSeqId;
            state.FixedAssetId           = this.FixedAssetId;
            state.MaintHistSeqId         = this.MaintHistSeqId;
            state.IssuedDateTime         = this.IssuedDateTime;
            state.IssuedByUserLoginId    = this.IssuedByUserLoginId;
            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.ShipmentId = this.ShipmentId;
            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 IItemIssuanceState Get(string itemIssuanceSeqId, bool forCreation, bool nullAllowed)
        {
            ShipmentItemIssuanceId globalId = new ShipmentItemIssuanceId(_shipmentState.ShipmentId, itemIssuanceSeqId);

            if (_loadedItemIssuanceStates.ContainsKey(globalId))
            {
                var state = _loadedItemIssuanceStates[globalId];
                if (this._shipmentState != null && this._shipmentState.ReadOnly == false)
                {
                    ((IItemIssuanceState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new ItemIssuanceState(ForReapplying);
                state.ShipmentItemIssuanceId = globalId;
                _loadedItemIssuanceStates.Add(globalId, state);
                if (this._shipmentState != null && this._shipmentState.ReadOnly == false)
                {
                    ((IItemIssuanceState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = ItemIssuanceStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedItemIssuanceStates.Add(globalId, state);
                }
                if (this._shipmentState != null && this._shipmentState.ReadOnly == false)
                {
                    ((IItemIssuanceState)state).ReadOnly = false;
                }
                return(state);
            }
        }
Пример #3
0
 public static CreateItemIssuance ToCreateItemIssuance(this ItemIssuanceState state)
 {
     return(state.ToCreateItemIssuance <CreateItemIssuance>());
 }
Пример #4
0
 public static MergePatchItemIssuance ToMergePatchItemIssuance(this ItemIssuanceState state)
 {
     return(state.ToMergePatchItemIssuance <MergePatchItemIssuance>());
 }
Пример #5
0
 public static RemoveItemIssuance ToRemoveItemIssuance(this ItemIssuanceState state)
 {
     return(state.ToRemoveItemIssuance <RemoveItemIssuance>());
 }
Пример #6
0
 public static IItemIssuanceCommand ToCreateOrMergePatchItemIssuance(this ItemIssuanceState state)
 {
     return(state.ToCreateOrMergePatchItemIssuance <CreateItemIssuance, MergePatchItemIssuance>());
 }