/// <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.DebtNegotiator record = new TradingSupportReference.DebtNegotiator(); this.PopulateRecord(record); if (this.EntityId == Guid.Empty) { MethodResponseArrayOfguid response = tradingSupportClient.CreateDebtNegotiator(new TradingSupportReference.DebtNegotiator[] { record }); if (!response.IsSuccessful) { Entity.ThrowErrorInfo(response.Errors[0]); } } else { MethodResponseErrorCode response = tradingSupportClient.UpdateDebtNegotiator(new TradingSupportReference.DebtNegotiator[] { record }); if (!response.IsSuccessful) { Entity.ThrowErrorInfo(response.Errors[0]); } } tradingSupportClient.Close(); }