|
@@ -211,12 +211,17 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private decimal totalCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
private decimal totalCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
|
|
|
+ private decimal totalCustomSummaryValueDaysReceiptToAppendixOfferingCount = 0;
|
|
|
private decimal totalCustomSummaryValueDisturbanceValueSum = 0;
|
|
private decimal totalCustomSummaryValueDisturbanceValueSum = 0;
|
|
|
|
|
|
|
|
private decimal accumulatedCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
private decimal accumulatedCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
|
|
|
+ private int accumulatedCustomSummaryValueDaysReceiptToAppendixOfferingCount = 0;
|
|
|
|
|
+ private decimal accumulatedCustomSummaryPercentage = 0;
|
|
|
|
|
+ private int accumulatedCustomSummaryPercentageCount = 0;
|
|
|
private decimal accumulatedCustomSummaryValueDisturbanceValueSum = 0;
|
|
private decimal accumulatedCustomSummaryValueDisturbanceValueSum = 0;
|
|
|
- private decimal accumulatedValue = 0;
|
|
|
|
|
- private decimal accumulatedCount = 0;
|
|
|
|
|
|
|
+ private decimal accumulatedCustomSummaryPercentageValue = 0;
|
|
|
|
|
+ private decimal accumulatedCustomSummaryValue = 0;
|
|
|
|
|
+ private decimal accumulatedCustomSummaryCount = 0;
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Reset custom summaries for corresponding group type
|
|
/// Reset custom summaries for corresponding group type
|
|
@@ -225,8 +230,14 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
/// <param name="e"></param>
|
|
/// <param name="e"></param>
|
|
|
private void generator_SummaryReset(object source, CustomSummaryResetEventArgs e)
|
|
private void generator_SummaryReset(object source, CustomSummaryResetEventArgs e)
|
|
|
{
|
|
{
|
|
|
- totalCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
|
|
|
- totalCustomSummaryValueDisturbanceValueSum = 0;
|
|
|
|
|
|
|
+ if (e.FieldName == "DaysReceiptToAppendixOffering")
|
|
|
|
|
+ {
|
|
|
|
|
+ totalCustomSummaryValueDaysReceiptToAppendixOffering = 0;
|
|
|
|
|
+ totalCustomSummaryValueDaysReceiptToAppendixOfferingCount = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (e.FieldName == "DisturbanceValuesDescription")
|
|
|
|
|
+ totalCustomSummaryValueDisturbanceValueSum = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -237,8 +248,15 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
private void generator_SummaryRowChanged(object source, CustomSummaryRowChangedEventArgs e)
|
|
private void generator_SummaryRowChanged(object source, CustomSummaryRowChangedEventArgs e)
|
|
|
{
|
|
{
|
|
|
if (e.FieldName == "DaysReceiptToAppendixOffering")
|
|
if (e.FieldName == "DaysReceiptToAppendixOffering")
|
|
|
- totalCustomSummaryValueDaysReceiptToAppendixOffering +=
|
|
|
|
|
- Convert.ToDecimal(((XtraReport)source).GetCurrentColumnValue("DaysReceiptToAppendixOffering"));
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ var val = ((XtraReport)source).GetCurrentColumnValue("DaysReceiptToAppendixOffering");
|
|
|
|
|
+
|
|
|
|
|
+ if (val != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ totalCustomSummaryValueDaysReceiptToAppendixOffering += Convert.ToDecimal(val);
|
|
|
|
|
+ totalCustomSummaryValueDaysReceiptToAppendixOfferingCount++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (e.FieldName == "DisturbanceValuesDescription")
|
|
if (e.FieldName == "DisturbanceValuesDescription")
|
|
|
{
|
|
{
|
|
@@ -258,26 +276,58 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
|
|
|
|
|
if (label.Tag.ToString() == "DaysReceiptToAppendixOffering")
|
|
if (label.Tag.ToString() == "DaysReceiptToAppendixOffering")
|
|
|
{
|
|
{
|
|
|
- accumulatedCustomSummaryValueDaysReceiptToAppendixOffering += e.CalculatedValues.OfType<int>().Sum();
|
|
|
|
|
- e.Result = accumulatedCustomSummaryValueDaysReceiptToAppendixOffering;
|
|
|
|
|
|
|
+ accumulatedCustomSummaryValueDaysReceiptToAppendixOffering += e.CalculatedValues.OfType<int?>()
|
|
|
|
|
+ .Where(c => c.HasValue)
|
|
|
|
|
+ .Select(c => Convert.ToDecimal(c))
|
|
|
|
|
+ .Sum();
|
|
|
|
|
+ accumulatedCustomSummaryValueDaysReceiptToAppendixOfferingCount += e.CalculatedValues.OfType<int?>()
|
|
|
|
|
+ .Where(c => c.HasValue)
|
|
|
|
|
+ .Count();
|
|
|
|
|
+ e.Result = accumulatedCustomSummaryValueDaysReceiptToAppendixOffering /
|
|
|
|
|
+ accumulatedCustomSummaryValueDaysReceiptToAppendixOfferingCount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (label.Tag.ToString() == "DisturbanceValueSum")
|
|
|
|
|
|
|
+ if (label.Tag.ToString() == "DisturbanceValuesDescription")
|
|
|
{
|
|
{
|
|
|
- accumulatedCustomSummaryValueDisturbanceValueSum += e.CalculatedValues.OfType<decimal>().Sum();
|
|
|
|
|
|
|
+ var vals = e.CalculatedValues.OfType<string>()
|
|
|
|
|
+ .Where(s => !String.IsNullOrEmpty(s))
|
|
|
|
|
+ .SelectMany(s => s.Split(new[] { ", " }, StringSplitOptions.None))
|
|
|
|
|
+ .Select(s => s.Split(new[] { " - " }, StringSplitOptions.None)[1])
|
|
|
|
|
+ .Select(s => s.Take(s.Length - 2))
|
|
|
|
|
+ .Select(c => String.Join("", c))
|
|
|
|
|
+ .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ accumulatedCustomSummaryValueDisturbanceValueSum += vals
|
|
|
|
|
+ .Select(v => Convert.ToDecimal(v))
|
|
|
|
|
+ .Sum();
|
|
|
|
|
+
|
|
|
e.Result = accumulatedCustomSummaryValueDisturbanceValueSum;
|
|
e.Result = accumulatedCustomSummaryValueDisturbanceValueSum;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (label.Tag.ToString() == "Value")
|
|
if (label.Tag.ToString() == "Value")
|
|
|
{
|
|
{
|
|
|
- accumulatedValue += e.CalculatedValues.OfType<decimal>().Sum();
|
|
|
|
|
- e.Result = accumulatedValue;
|
|
|
|
|
|
|
+ accumulatedCustomSummaryValue += e.CalculatedValues.OfType<decimal>().Sum();
|
|
|
|
|
+ e.Result = accumulatedCustomSummaryValue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (label.Tag.ToString() == "SiteDescription")
|
|
if (label.Tag.ToString() == "SiteDescription")
|
|
|
{
|
|
{
|
|
|
- accumulatedCount += e.CalculatedValues.Count;
|
|
|
|
|
- e.Result = accumulatedCount;
|
|
|
|
|
|
|
+ accumulatedCustomSummaryCount += e.CalculatedValues.Count;
|
|
|
|
|
+ e.Result = accumulatedCustomSummaryCount;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (label.Tag.ToString() == "Percentage")
|
|
|
|
|
+ {
|
|
|
|
|
+ accumulatedCustomSummaryPercentage += e.CalculatedValues.OfType<decimal>().Sum();
|
|
|
|
|
+ accumulatedCustomSummaryPercentageCount += e.CalculatedValues.Count;
|
|
|
|
|
+ e.Result = accumulatedCustomSummaryPercentage /
|
|
|
|
|
+ accumulatedCustomSummaryPercentageCount;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (label.Tag.ToString() == "PercentageValue")
|
|
|
|
|
+ {
|
|
|
|
|
+ accumulatedCustomSummaryPercentageValue += e.CalculatedValues.OfType<decimal>().Sum();
|
|
|
|
|
+ e.Result = accumulatedCustomSummaryPercentageValue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
e.Handled = true;
|
|
@@ -293,12 +343,17 @@ namespace GreenTree.Nachtragsmanagement.Web.Controllers
|
|
|
var label = (XRLabel)source;
|
|
var label = (XRLabel)source;
|
|
|
|
|
|
|
|
if (label.Tag.ToString() == "DaysReceiptToAppendixOffering")
|
|
if (label.Tag.ToString() == "DaysReceiptToAppendixOffering")
|
|
|
- e.Result = totalCustomSummaryValueDaysReceiptToAppendixOffering;
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ e.Result = Convert.ToInt32(totalCustomSummaryValueDaysReceiptToAppendixOffering /
|
|
|
|
|
+ totalCustomSummaryValueDaysReceiptToAppendixOfferingCount);
|
|
|
|
|
+ e.Handled = true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (label.Tag.ToString() == "DisturbanceValuesDescription")
|
|
if (label.Tag.ToString() == "DisturbanceValuesDescription")
|
|
|
|
|
+ {
|
|
|
e.Result = totalCustomSummaryValueDisturbanceValueSum;
|
|
e.Result = totalCustomSummaryValueDisturbanceValueSum;
|
|
|
-
|
|
|
|
|
- e.Handled = true;
|
|
|
|
|
|
|
+ e.Handled = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|