Пример #1
0
        internal void NotifyOrderDeleted(Guid orderID)
        {
            OrderDeleted orderDeleted = new OrderDeleted(orderID);

            lock (this._ToBeSendEntitiesLock)
            {
                this._ToBeSendEntities.Enqueue(orderDeleted);
            }
            this._HasToBeSendEntityEvent.Set();
        }
Пример #2
0
        private void Send(object emailEntity)
        {
            try
            {
                Execution execution = emailEntity as Execution;
                if (execution != null)
                {
                    Logger.InfoFormat("TransactonServer.NotifyExecution(before send) OrderId= {0}", execution.OrderId);
                    this._EmailService.NotifyOrderExecuted(execution.OrderId);
                    Logger.InfoFormat("TransactonServer.NotifyExecution(after send) OrderId= {0}", execution.OrderId);
                    return;
                }

                AccountRisk accountRisk = emailEntity as AccountRisk;
                if (accountRisk != null)
                {
                    this._EmailService.NotifyRiskLevelChanged(accountRisk.ToRiskLevelChangedInfo());
                    return;
                }

                BalanceInfo balanceInfo = emailEntity as BalanceInfo;
                if (balanceInfo != null)
                {
                    this._EmailService.NotifyBalanceChanged(balanceInfo);
                    return;
                }

                OrderDeleted orderDeleted = emailEntity as OrderDeleted;
                if (orderDeleted != null)
                {
                    this._EmailService.NotifyOrderDeleted(orderDeleted.OrderId);
                    return;
                }

                TradeDayReset tradeDayReset = emailEntity as TradeDayReset;
                if (tradeDayReset != null)
                {
                    this._EmailService.NotifyResetStatement(tradeDayReset.TradeDay.Day);
                    this.SetTradeDayResetEmailGenerated(tradeDayReset.TradeDay.Day);
                    return;
                }

                PasswordResetInfo passwordResetInfo = emailEntity as PasswordResetInfo;
                if (passwordResetInfo != null)
                {
                    this._EmailService.NotifyPasswordReset(passwordResetInfo);
                }

                VerificationCodeInfo verificationCodeInfo = emailEntity as VerificationCodeInfo;
                if (verificationCodeInfo != null)
                {
                    this._EmailService.NotifyTelephonePinReset(verificationCodeInfo);
                }

                ApplyDelivery applyDelivery = emailEntity as ApplyDelivery;
                if (applyDelivery != null)
                {
                    this._EmailService.NotifyDeliveryListing(applyDelivery.DeliveryRequestId);
                }
            }
            catch (Exception exception)
            {
                Logger.Error(emailEntity.ToString(), exception);
            }
        }