internal Order(Transaction owner, BOOrderConstructParams constructParams, OrderServiceFactoryBase serviceFactory) : base(owner, constructParams, serviceFactory) { if (this.IsOpen) { this.PayBackPledge = 0m; _boOrderSettings = (BOOrderSettings)_orderSettings; _bOBetType = BOBetTypeRepository.Get(_boOrderSettings.BetTypeId); this.CalculateNextHitTime(); if (this.HitCount > 0) { _betResult = this.CalculateBetResult(this.BestPrice, this.GetBetDirection(this.HitCount - 1)); } } }
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); }
internal PhysicalOrder(Transaction owner, PhysicalOrderConstructParams constructParams, OrderServiceFactoryBase factory) : base(owner, constructParams, factory) { _physicalSettings = (PhysicalOrderSettings)_orderSettings; _instalment = _physicalSettings.Instalment; _instalmentDetailManager = new InstalmentDetailManager(this, _instalment); }