Witam.
Ma ktoś może pomysł dlaczego ta funkcja:
public void GenerateReport()
{
foreach (var inv in invoices)
{
if (reports.Any(n => n.Localisation == inv.Reciever.Address.PostalCode.First().ToString((CultureInfo.InvariantCulture)) == false))
{
var report = new Report
{
Localisation = inv.Reciever.Address.PostalCode.First().ToString(CultureInfo.InvariantCulture)
};
double sumaKwotFaktur = 0;
foreach (var invoiceTMP in
invoices.Where(
n =>
n.Reciever.Address.PostalCode.First().ToString(CultureInfo.InvariantCulture) ==
inv.Reciever.Address.PostalCode.First().ToString(CultureInfo.InvariantCulture)))
{
sumaKwotFaktur += Convert.ToDouble(invoiceTMP.GrossAmount);
}
report.SumOfAmount = sumaKwotFaktur.ToString(CultureInfo.InvariantCulture);
reports.Add(report);
}
ReportDataGrid.ItemsSource = reports;
}
Powoduje zwrócenie wyjątku "Wartość nie może być zerowa" ?