From cc166746f553153caaea9a5d41a4e59c5eab43fd Mon Sep 17 00:00:00 2001 From: Alexey Busygin Date: Sat, 17 Aug 2024 13:41:59 +0200 Subject: [PATCH] Adjust namespaces --- ShippingRates/Models/PackageKgCm.cs | 2 +- ShippingRates/Models/UnitsSystem.cs | 2 +- ShippingRates/ShippingProviders/DHLProvider.cs | 8 ++++---- ShippingRates/ShippingProviders/FedExBaseProvider.cs | 8 ++++---- .../ShippingProviders/USPSInternationalProvider.cs | 8 ++++---- ShippingRates/ShippingProviders/USPSProvider.cs | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ShippingRates/Models/PackageKgCm.cs b/ShippingRates/Models/PackageKgCm.cs index 7b526aa..cadd868 100644 --- a/ShippingRates/Models/PackageKgCm.cs +++ b/ShippingRates/Models/PackageKgCm.cs @@ -1,4 +1,4 @@ -namespace ShippingRates.Models +namespace ShippingRates { /// /// Package object with dimensions in kgs and cm diff --git a/ShippingRates/Models/UnitsSystem.cs b/ShippingRates/Models/UnitsSystem.cs index 8f82999..5ee7c20 100644 --- a/ShippingRates/Models/UnitsSystem.cs +++ b/ShippingRates/Models/UnitsSystem.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace ShippingRates.Models +namespace ShippingRates { public enum UnitsSystem { diff --git a/ShippingRates/ShippingProviders/DHLProvider.cs b/ShippingRates/ShippingProviders/DHLProvider.cs index 891d3e5..972a3f6 100644 --- a/ShippingRates/ShippingProviders/DHLProvider.cs +++ b/ShippingRates/ShippingProviders/DHLProvider.cs @@ -143,10 +143,10 @@ private string BuildRatesRequestMessage( { writer.WriteStartElement("Piece"); writer.WriteElementString("PieceID", $"{i + 1}"); - writer.WriteElementString("Height", Shipment.Packages[i].GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString(requestCulture)); - writer.WriteElementString("Depth", Shipment.Packages[i].GetRoundedLength(Models.UnitsSystem.USCustomary).ToString(requestCulture)); - writer.WriteElementString("Width", Shipment.Packages[i].GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString(requestCulture)); - writer.WriteElementString("Weight", Shipment.Packages[i].GetRoundedWeight(Models.UnitsSystem.USCustomary).ToString(requestCulture)); + writer.WriteElementString("Height", Shipment.Packages[i].GetRoundedHeight(UnitsSystem.USCustomary).ToString(requestCulture)); + writer.WriteElementString("Depth", Shipment.Packages[i].GetRoundedLength(UnitsSystem.USCustomary).ToString(requestCulture)); + writer.WriteElementString("Width", Shipment.Packages[i].GetRoundedWidth(UnitsSystem.USCustomary).ToString(requestCulture)); + writer.WriteElementString("Weight", Shipment.Packages[i].GetRoundedWeight(UnitsSystem.USCustomary).ToString(requestCulture)); writer.WriteEndElement(); // } writer.WriteEndElement(); // diff --git a/ShippingRates/ShippingProviders/FedExBaseProvider.cs b/ShippingRates/ShippingProviders/FedExBaseProvider.cs index 4d94ff0..cdde709 100644 --- a/ShippingRates/ShippingProviders/FedExBaseProvider.cs +++ b/ShippingRates/ShippingProviders/FedExBaseProvider.cs @@ -265,16 +265,16 @@ protected void SetPackageLineItems(RateRequest request) { Units = WeightUnits.LB, // TODO: Add support for CM and KG UnitsSpecified = true, - Value = Shipment.Packages[i].GetRoundedWeight(Models.UnitsSystem.USCustomary), + Value = Shipment.Packages[i].GetRoundedWeight(UnitsSystem.USCustomary), ValueSpecified = true }, // Package dimensions Dimensions = new Dimensions() { - Length = Shipment.Packages[i].GetRoundedLength(Models.UnitsSystem.USCustomary).ToString(), - Width = Shipment.Packages[i].GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString(), - Height = Shipment.Packages[i].GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString(), + Length = Shipment.Packages[i].GetRoundedLength(UnitsSystem.USCustomary).ToString(), + Width = Shipment.Packages[i].GetRoundedWidth(UnitsSystem.USCustomary).ToString(), + Height = Shipment.Packages[i].GetRoundedHeight(UnitsSystem.USCustomary).ToString(), Units = LinearUnits.IN, // TODO: Add support for CM and KG UnitsSpecified = true } diff --git a/ShippingRates/ShippingProviders/USPSInternationalProvider.cs b/ShippingRates/ShippingProviders/USPSInternationalProvider.cs index 8b5e27c..9cd5b92 100644 --- a/ShippingRates/ShippingProviders/USPSInternationalProvider.cs +++ b/ShippingRates/ShippingProviders/USPSInternationalProvider.cs @@ -149,10 +149,10 @@ private string GetRequestXmlString() writer.WriteElementString("ValueOfContents", package.InsuredValue.ToString()); writer.WriteElementString("Country", Shipment.DestinationAddress.GetCountryName()); writer.WriteElementString("Container", string.IsNullOrEmpty(package.Container) ? "RECTANGULAR" : package.Container); - writer.WriteElementString("Width", package.GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Length", package.GetRoundedLength(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Height", package.GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Girth", package.GetCalculatedGirth(Models.UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Width", package.GetRoundedWidth(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Length", package.GetRoundedLength(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Height", package.GetRoundedHeight(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Girth", package.GetCalculatedGirth(UnitsSystem.USCustomary).ToString()); writer.WriteElementString("OriginZip", Shipment.OriginAddress.PostalCode); writer.WriteElementString("CommercialFlag", Commercial ? "Y" : "N"); diff --git a/ShippingRates/ShippingProviders/USPSProvider.cs b/ShippingRates/ShippingProviders/USPSProvider.cs index 92cfec8..31fa6e6 100644 --- a/ShippingRates/ShippingProviders/USPSProvider.cs +++ b/ShippingRates/ShippingProviders/USPSProvider.cs @@ -178,10 +178,10 @@ private string GetRequestXmlString(List specialServices) writer.WriteElementString("Ounces", package.PoundsAndOunces.Ounces.ToString()); writer.WriteElementString("Container", string.IsNullOrEmpty(package.Container) ? string.Empty : package.Container); - writer.WriteElementString("Width", package.GetRoundedWidth(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Length", package.GetRoundedLength(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Height", package.GetRoundedHeight(Models.UnitsSystem.USCustomary).ToString()); - writer.WriteElementString("Girth", package.GetCalculatedGirth(Models.UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Width", package.GetRoundedWidth(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Length", package.GetRoundedLength(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Height", package.GetRoundedHeight(UnitsSystem.USCustomary).ToString()); + writer.WriteElementString("Girth", package.GetCalculatedGirth(UnitsSystem.USCustomary).ToString()); writer.WriteElementString("Value", package.InsuredValue.ToString()); if (RequiresMachinable(_configuration.Service)) {