/// <summary>
        /// Actual execute a move by moving the securities.
        /// </summary>
        /// <param name="client">The trading support client to use.</param>
        /// <param name="records">The security records to move.</param>
        /// <param name="newParent">The new blotter.</param>
        /// <returns>The server response</returns>
        protected override MethodResponseErrorCode MoveSecurity(
            TradingSupportClient client,
            BaseRecord[] records,
            Blotter newParent)
        {
            MethodResponseErrorCode response = null;

            response = client.MoveConsumerDebtToBlotter(newParent.BlotterId, records);

            return(response);
        }
Exemple #2
0
        public static void MoveConsumerDebtToBlotter(Guid blotterId, BaseRecord[] consumerDebt)
        {
            // Update the database.
            TradingSupportClient tradingSupportClient = new TradingSupportClient(Guardian.Properties.Settings.Default.TradingSupportEndpoint);

            try
            {
                MethodResponseErrorCode response = tradingSupportClient.MoveConsumerDebtToBlotter(blotterId, consumerDebt);
            }
            catch (Exception exception)
            {
                // Any issues trying to communicate to the server are logged.
                EventLog.Error("{0}, {1}", exception.Message, exception.StackTrace);
            }
            finally
            {
                if (tradingSupportClient != null && tradingSupportClient.State == CommunicationState.Opened)
                {
                    tradingSupportClient.Close();
                }
            }
        }