-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportSimple.cs
More file actions
32 lines (30 loc) · 941 Bytes
/
ReportSimple.cs
File metadata and controls
32 lines (30 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using ProductivityTools.GetTask3.Contract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProductivityTools.GetTask3.Reporting
{
internal class ReportSimple
{
public static string PrepareReport(Contract.ElementView rootElement)
{
var result = FindClosed(rootElement.Name, rootElement);
return result;
}
private static string FindClosed(string path, Contract.ElementView element)
{
if (element.Finished.HasValue && element.Finished.Value > DateTime.Now.AddDays(-1))
{
return string.Concat(path, "\\", element.Name) + "<br/>";
}
var r = string.Empty;
foreach (var item in element.Elements)
{
r += FindClosed(element.Name, item);
}
return r;
}
}
}