コード例 #1
0
 public virtual void Save()
 {
     foreach (IOrderShipGroupState s in this.LoadedOrderShipGroupStates)
     {
         OrderShipGroupStateDao.Save(s);
     }
     foreach (IOrderShipGroupState s in this._removedOrderShipGroupStates.Values)
     {
         OrderShipGroupStateDao.Delete(s);
     }
 }
コード例 #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);
            }
        }