2023-03-08 09:33:11 +01:00

106 lines
2.8 KiB
C#

using DevExpress.Map.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReportViewer
{
public class ReportData
{
public List<Order> Orders { get; set; }
public class Order
{
public int Id { get; set; }
public string OrderNumber { get; set; }
public DateTime OrderDate { get; set; }
public string ShipmentIdentifiers { get; set; }
public string Loadings { get; set; }
public double WeightAmount { get; set; }
public string WeightUnit { get; set; }
public string InformationForDriver { get; set; }
public string InformationForDeliveryNotice { get; set; }
public string InformationForDevlieryAdditional { get; set; }
public string InformationForDelivery
{
get
{
return $"{InformationForDeliveryNotice} {InformationForDevlieryAdditional}";
}
}
public string Weight
{
get
{
return $"{WeightAmount:n2} {WeightUnit}";
}
}
public int ShipmentIdentifiersAmount
{
get
{
return ShipmentIdentifiers != null ? ShipmentIdentifiers.Split(Environment.NewLine).Length : 0;
}
}
public string Address
{
get
{
return Receiver.Complete;
}
}
public Address Receiver { get; set; }
public HeadData Head { get; set; }
}
public class HeadData
{
public string Title { get; set; }
public Address Sender { get; set; }
public Address Receiver { get; set; }
}
public class Address
{
public string Name { get; set; } = "";
public string Street { get; set; } = "";
public string Zip { get; set; } = "";
public string City { get; set; } = "";
public string Country { get; set; } = "D";
public string ZipCodeCountryCity
{
get
{
if (City.Length > 0 && Zip.Length > 0)
return $"{Country}-{Zip} {City}";
return "";
}
}
public string Complete
{
get
{
return Name + Environment.NewLine +
Street + Environment.NewLine +
ZipCodeCountryCity;
}
}
}
}
}