Exemple #1
0
        /// <summary>
        /// Commit any changes to the debt class to the server.
        /// </summary>
        protected override void CommitDebtClass()
        {
            TradingSupportClient tradingSupportClient = new TradingSupportClient(Guardian.Properties.Settings.Default.TradingSupportEndpoint);

            TradingSupportReference.DebtHolder record = new TradingSupportReference.DebtHolder();

            this.PopulateRecord(record);

            if (this.EntityId == Guid.Empty)
            {
                MethodResponseArrayOfguid response = tradingSupportClient.CreateDebtHolder(new TradingSupportReference.DebtHolder[] { record });

                if (!response.IsSuccessful)
                {
                    Entity.ThrowErrorInfo(response.Errors[0]);
                }
            }
            else
            {
                MethodResponseErrorCode response = tradingSupportClient.UpdateDebtHolder(new TradingSupportReference.DebtHolder[] { record });

                if (!response.IsSuccessful)
                {
                    Entity.ThrowErrorInfo(response.Errors[0]);
                }
            }

            tradingSupportClient.Close();
        }