diff --git a/MYOB.API.SDK/SDK.NET45/Services/Version2/Banking/SpendMoneyAttachmentService.cs b/MYOB.API.SDK/SDK.NET45/Services/Version2/Banking/SpendMoneyAttachmentService.cs index b39a5b8..bd84b52 100644 --- a/MYOB.API.SDK/SDK.NET45/Services/Version2/Banking/SpendMoneyAttachmentService.cs +++ b/MYOB.API.SDK/SDK.NET45/Services/Version2/Banking/SpendMoneyAttachmentService.cs @@ -595,10 +595,9 @@ private string GenerateQueryString(ErrorLevel errorLevel, bool returnBody = fals // baseUrl/Banking/SpendMoneyTxn/spendMoneyUid/Attachment public Uri BuildUri(CompanyFile companyFile, Guid spendMoneyUid, Guid? attachmentUid = null, string queryString = null) { - var qs = string.IsNullOrEmpty(queryString) ? string.Empty : queryString; - var attchUid = attachmentUid.HasValue ? "/" + attachmentUid.ToString() : string.Empty; - - return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Banking/SpendMoneyTxn", spendMoneyUid.ToString(), "/Attachment", attchUid, qs)); + string text = (string.IsNullOrEmpty(queryString) ? string.Empty : (queryString.StartsWith("?") ? queryString : ("?" + queryString))); + string text2 = (attachmentUid.HasValue ? ("/" + attachmentUid.ToString()) : string.Empty); + return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Banking/SpendMoneyTxn", spendMoneyUid.ToString(), "/Attachment", text2, text)); } } } diff --git a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ItemBillAttachmentService.cs b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ItemBillAttachmentService.cs index 48d7db0..faa6ed3 100644 --- a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ItemBillAttachmentService.cs +++ b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ItemBillAttachmentService.cs @@ -616,10 +616,10 @@ private string GenerateQueryString(ErrorLevel errorLevel, bool returnBody = fals // baseUrl/Purchase/Bill/Item/billUid/Attachment public Uri BuildUri(CompanyFile companyFile, Guid billUid, Guid? attachmentUid = null, string queryString = null) { - var qs = string.IsNullOrEmpty(queryString) ? string.Empty : queryString; - var attchUid = attachmentUid.HasValue ? "/" + attachmentUid.ToString() : string.Empty; + string text = (string.IsNullOrEmpty(queryString) ? string.Empty : (queryString.StartsWith("?") ? queryString : ("?" + queryString))); + string text2 = (attachmentUid.HasValue ? ("/" + attachmentUid.ToString()) : string.Empty); - return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Item", billUid.ToString(), "/Attachment", attchUid, qs)); + return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Item", billUid.ToString(), "/Attachment", text2, text)); } } } diff --git a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/MiscellaneousBillAttachmentService.cs b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/MiscellaneousBillAttachmentService.cs index 6c35220..cd20901 100644 --- a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/MiscellaneousBillAttachmentService.cs +++ b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/MiscellaneousBillAttachmentService.cs @@ -616,10 +616,10 @@ private string GenerateQueryString(ErrorLevel errorLevel, bool returnBody = fals // baseUrl/Purchase/Bill/Miscellaneous/billUid/Attachment public Uri BuildUri(CompanyFile companyFile, Guid billUid, Guid? attachmentUid = null, string queryString = null) { - var qs = string.IsNullOrEmpty(queryString) ? string.Empty : queryString; - var attchUid = attachmentUid.HasValue ? "/" + attachmentUid.ToString() : string.Empty; + string text = (string.IsNullOrEmpty(queryString) ? string.Empty : (queryString.StartsWith("?") ? queryString : ("?" + queryString))); + string text2 = (attachmentUid.HasValue ? ("/" + attachmentUid.ToString()) : string.Empty); - return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Miscellaneous", billUid.ToString(), "/Attachment", attchUid, qs)); + return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Miscellaneous", billUid.ToString(), "/Attachment", text2, text)); } } } diff --git a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ProfessionalBillAttachmentService.cs b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ProfessionalBillAttachmentService.cs index a8b95d1..f2de72f 100644 --- a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ProfessionalBillAttachmentService.cs +++ b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ProfessionalBillAttachmentService.cs @@ -616,10 +616,10 @@ private string GenerateQueryString(ErrorLevel errorLevel, bool returnBody = fals // baseUrl/Purchase/Bill/Professional/billUid/Attachment public Uri BuildUri(CompanyFile companyFile, Guid billUid, Guid? attachmentUid = null, string queryString = null) { - var qs = string.IsNullOrEmpty(queryString) ? string.Empty : queryString; - var attchUid = attachmentUid.HasValue ? "/" + attachmentUid.ToString() : string.Empty; + string text = (string.IsNullOrEmpty(queryString) ? string.Empty : (queryString.StartsWith("?") ? queryString : ("?" + queryString))); + string text2 = (attachmentUid.HasValue ? ("/" + attachmentUid.ToString()) : string.Empty); - return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Professional", billUid.ToString(), "/Attachment", attchUid, qs)); + return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Professional", billUid.ToString(), "/Attachment", text2, text)); } } } diff --git a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ServiceBillAttachmentService.cs b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ServiceBillAttachmentService.cs index 70b53c7..78103e6 100644 --- a/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ServiceBillAttachmentService.cs +++ b/MYOB.API.SDK/SDK.NET45/Services/Version2/Purchase/ServiceBillAttachmentService.cs @@ -616,10 +616,10 @@ private string GenerateQueryString(ErrorLevel errorLevel, bool returnBody = fals // baseUrl/Purchase/Bill/Service/billUid/Attachment public Uri BuildUri(CompanyFile companyFile, Guid billUid, Guid? attachmentUid = null, string queryString = null) { - var qs = string.IsNullOrEmpty(queryString) ? string.Empty : queryString; - var attchUid = attachmentUid.HasValue ? "/" + attachmentUid.ToString() : string.Empty; + string text = (string.IsNullOrEmpty(queryString) ? string.Empty : (queryString.StartsWith("?") ? queryString : ("?" + queryString))); + string text2 = (attachmentUid.HasValue ? ("/" + attachmentUid.ToString()) : string.Empty); - return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Service", billUid.ToString(), "/Attachment", attchUid, qs)); + return new Uri(string.Format("{0}/{1}/{2}{3}{4}{5}", companyFile.Uri, "Purchase/Bill/Service", billUid.ToString(), "/Attachment", text2, text)); } } }