コード例 #1
0
ファイル: Order.cs プロジェクト: dreamsql/Outter
 internal Order(Transaction owner, OrderConstructParams constructParams, OrderServiceFactoryBase serviceFactory)
     : base(BusinessRecordNames.Order, ATTRIBUTE_ITEMS_CAPACITY)
 {
     this.ConstructParams = constructParams;
     this.ServiceFactory  = serviceFactory;
     _pairOrderIsHit      = false;
     this.IsHitReseted    = false;
     _owner         = owner;
     _orderSettings = serviceFactory.CreateOrderSettings(this, constructParams);
     if (owner != null)
     {
         owner.AddOrder(this, constructParams.OperationType);
     }
     _orderRelations       = new BusinessRecordDictionary <Guid, OrderRelation>(BusinessRecordCollectionNames.OrderRelations, this, ORDER_RELATION_CAPACITY);
     _feeCalculator        = new Lazy <OrderFeeCalculatorBase>(() => serviceFactory.CreateOrderFeeCalculator(this, _orderSettings));
     _openOrderCalculator  = new Lazy <OpenOrderCalculatorBase>(() => serviceFactory.CreateOpenOrderCalculator(this, _orderSettings));
     _closeOrderCalculator = new Lazy <CloseOrderCalculator>(() => serviceFactory.CreateCloseOrderCalculator(this, _orderSettings));
     _executeService       = new Lazy <OrderExecuteServiceBase>(() => serviceFactory.CreateOrderExecuteService(this, _orderSettings));
     _precheckServcie      = new Lazy <OrderPreCheckServiceBase>(() => serviceFactory.CreatePreCheckService(this));
     _valuedPLCalculator   = new Lazy <ValuedPLCalculatorBase>(() => serviceFactory.CreateValuedPLCalculator(this));
     _currencyId           = BusinessItemFactory.Create("CurrencyID", owner.CurrencyId, PermissionFeature.ReadOnly, this);
 }
コード例 #2
0
 private void Initialize(DeliveryRequestConstructParams constructParams)
 {
     _id                            = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Id, constructParams.Id, PermissionFeature.Key, this);
     _accountId                     = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.AccountId, constructParams.AccountId, PermissionFeature.ReadOnly, this);
     _instrumentId                  = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.InstrumentId, constructParams.InstrumentId, PermissionFeature.ReadOnly, this);
     _code                          = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Code, constructParams.Code, PermissionFeature.ReadOnly, this);
     _printingCode                  = BusinessItemFactory.Create("PrintingCode", constructParams.PrintingCode, PermissionFeature.ReadOnly, this);
     _ask                           = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Ask, constructParams.Ask, PermissionFeature.Sound, this);
     _bid                           = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Bid, constructParams.Bid, PermissionFeature.Sound, this);
     _deliveryRequestStatus         = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Status, constructParams.DeliveryRequestStatus, PermissionFeature.Sound, this);
     _requireQuantity               = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.RequireQuantity, constructParams.RequireQuantity, PermissionFeature.ReadOnly, this);
     _requireLot                    = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.RequireLot, constructParams.RequireLot, PermissionFeature.ReadOnly, this);
     _submitTime                    = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.SubmitTime, constructParams.SubmitTime, PermissionFeature.ReadOnly, this);
     _submitorId                    = BusinessItemFactory.Create("SubmitorId", constructParams.SubmitorId, PermissionFeature.ReadOnly, this);
     _deliveryTime                  = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.DeliveryTime, constructParams.DeliveryTime, PermissionFeature.Sound, this);
     _availableDeliveryTime         = BusinessItemFactory.Create("AvailableDeliveryTime", (DateTime?)null, PermissionFeature.Sound, this);
     _charge                        = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.Charge, constructParams.Charge, PermissionFeature.Sound, this);
     _chargeCurrencyId              = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.ChargeCurrencyId, constructParams.ChargeCurrencyId, PermissionFeature.Sound, this);
     _deliveryAddressId             = BusinessItemFactory.Create(DeliveryRequestBusinessItemNames.DeliveryAddressId, constructParams.DeliveryAddressId, PermissionFeature.Sound, this);
     _deliveryRequestOrderRelations = new BusinessRecordDictionary <Guid, DeliveryRequestOrderRelation>(BusinessRecordCollectionNames.DeliveryRequestOrderRelations, this);
     _specifications                = new BusinessRecordList <DeliveryRequestSpecification>("DeliveryRequestSpecifications", this, 2);
 }
 internal InstrumentManager(Account owner)
 {
     _owner       = owner;
     _instruments = new BusinessRecordDictionary <Guid, AccountClass.Instrument>("Instruments", owner);
 }