コード例 #1
0
ファイル: OrderRoleStateDto.cs プロジェクト: uwitec/wms-8
        public virtual IOrderRoleState ToOrderRoleState()
        {
            var state = new OrderRoleState(true);

            state.PartyRoleId = this.PartyRoleId;
            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;
            }

            return(state);
        }
コード例 #2
0
        public virtual IOrderRoleState Get(PartyRoleId partyRoleId, bool forCreation, bool nullAllowed)
        {
            OrderRoleId globalId = new OrderRoleId(_orderState.OrderId, partyRoleId);

            if (_loadedOrderRoleStates.ContainsKey(globalId))
            {
                var state = _loadedOrderRoleStates[globalId];
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderRoleState)state).ReadOnly = false;
                }
                return(state);
            }
            if (forCreation || ForReapplying)
            {
                var state = new OrderRoleState(ForReapplying);
                state.OrderRoleId = globalId;
                _loadedOrderRoleStates.Add(globalId, state);
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderRoleState)state).ReadOnly = false;
                }
                return(state);
            }
            else
            {
                var state = OrderRoleStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedOrderRoleStates.Add(globalId, state);
                }
                if (this._orderState != null && this._orderState.ReadOnly == false)
                {
                    ((IOrderRoleState)state).ReadOnly = false;
                }
                return(state);
            }
        }
コード例 #3
0
 public static CreateOrderRole ToCreateOrderRole(this OrderRoleState state)
 {
     return(state.ToCreateOrderRole <CreateOrderRole>());
 }
コード例 #4
0
 public static MergePatchOrderRole ToMergePatchOrderRole(this OrderRoleState state)
 {
     return(state.ToMergePatchOrderRole <MergePatchOrderRole>());
 }
コード例 #5
0
 public static RemoveOrderRole ToRemoveOrderRole(this OrderRoleState state)
 {
     return(state.ToRemoveOrderRole <RemoveOrderRole>());
 }
コード例 #6
0
 public static IOrderRoleCommand ToCreateOrMergePatchOrderRole(this OrderRoleState state)
 {
     return(state.ToCreateOrMergePatchOrderRole <CreateOrderRole, MergePatchOrderRole>());
 }