private string BuildGLSName(PakkeshopData parcelShop) { string separator = Environment.NewLine; if (string.IsNullOrEmpty(_glsSettings.Separator) == false) { separator = _glsSettings.Separator; } string name = parcelShop.CompanyName + " (" + parcelShop.Number + ")" + separator + parcelShop.Streetname + separator + parcelShop.ZipCode + " " + parcelShop.CityName; return(name); }
public PakkeshopData GetParcelShopData(string parcelNumber) { PakkeshopData parcelShop = null; try { wsShopFinderSoapClient client = new wsShopFinderSoapClient(EndpointConfiguration.wsShopFinderSoap12, _glsSettings.EndpointAddress); parcelShop = client.GetOneParcelShopAsync(parcelNumber).Result; } catch (Exception ex) { _logger.Error(ex.Message, ex); } if (parcelShop == null) { parcelShop = new PakkeshopData(); parcelShop.Number = "0"; parcelShop.Streetname = "Fejl ved hentning af pakkeshop data"; } return(parcelShop); }
private string CreateSingleLine(AOOrder order) { string glsShopnumber = ""; if (string.IsNullOrEmpty(order.ShippingInfo)) { throw new ArgumentException("No shipping info on order"); } if (order.ShippingInfo.Contains("(")) { glsShopnumber = order.ShippingInfo.Substring(order.ShippingInfo.IndexOf("(") + 1); if (glsShopnumber.Contains(")")) { glsShopnumber = glsShopnumber.Substring(0, glsShopnumber.IndexOf(")")); } } PakkeshopData pakkeshopData = _glsService.GetParcelShopData(glsShopnumber); if (pakkeshopData == null) { throw new ArgumentException("No Parcel shop found with number: '" + glsShopnumber + "'"); } StringBuilder sb = new StringBuilder(); sb.Append("\"" + order.Id.ToString() + "\""); // 1 Order number sb.Append(",\"" + pakkeshopData.CompanyName + "\""); // 2 Consignee name (Name of parcelshop) sb.Append(",\"" + order.CustomerInfo + "\""); // 3 Recipient address sb.Append(",\"" + pakkeshopData.Number + "\""); // 4 Parcelshop number sb.Append(",\"" + pakkeshopData.ZipCode + "\""); // 5 Zipcode of recipient sb.Append(",\"" + pakkeshopData.CityName + "\""); // 6 Postal district of recipient sb.Append(",\"" + pakkeshopData.CountryCode + "\""); // 7 Country of recipient sb.Append(",\"" + DateTime.Now.ToString("dd-MM-yy") + "\""); // 8 Date sb.Append(",\"1\""); // 9 Parcel weight sb.Append(",\"1\""); // 10 Number of parcels sb.Append(",\"\""); // 11 COD Amount (Order amount?) sb.Append(",\"\""); // 12 Parcel value amount (Total parcel value) sb.Append(",\"A\""); // 13 Parcel type sb.Append(",\"Z\""); // 14 Shipment type sb.Append(",\"" + order.UserName + "\""); // 15 Name of recipient to pick up parcel sb.Append(",\"\""); // 16 Customer note (not the one for friliv.dk) sb.Append(",\"90022\""); // 17 Customer number (vores GLS kundenummer) sb.Append(",\"" + order.CustomerEmail + "\""); // 18 Customer mail address sb.Append(",\"" + order.PhoneNumber + "\""); // 19 Customer mobile number sb.Append(",\"\"E"); // 20 Notification: E = Email sb.Append(",\"\"" + _settings.FTPPrinterName + "\""); // 21 Pxx = Printer no sb.Append(",\"\""); // 22 sb.Append(",\"\""); // 23 sb.Append(",\"\""); // 24 sb.Append(",\"\""); // 25 sb.Append(",\"\""); // 26 sb.Append(",\"\""); // 27 sb.Append(",\"\""); // 28 sb.Append(",\"\""); // 29 string info = sb.ToString(); return(info); }
private string GenerateStoreLocationLocation(PakkeshopData data) { return($"{data.Streetname} {data.CityName} - Ã…bningstider {GeneratePickupStoreOpeningHours(data.OpeningHours)}"); }