-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathProgram.cs
More file actions
67 lines (58 loc) · 2.25 KB
/
Program.cs
File metadata and controls
67 lines (58 loc) · 2.25 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using PayrollEngine;
using PayrollEngine.Client;
using PayrollEngine.Client.Scripting.Function.Api;
using PayrollEngine.Serilog;
using Tasks = System.Threading.Tasks;
namespace ReportPayroll;
/// <summary>Scripting development tutorial program</summary>
internal class Program : ConsoleProgram<Program>
{
private static ReportType currentReport = ReportType.EmployeeCaseValueEnd;
private enum ReportType
{
EmployeeCaseValueBuild,
EmployeeCaseValueEnd,
CumulativeJournalEnd
}
/// <summary>The script configuration</summary>
private ScriptConfiguration ScriptConfiguration =>
Configuration.GetConfiguration<ScriptConfiguration>();
/// <inheritdoc />
protected override Tasks.Task RunAsync()
{
switch (currentReport)
{
case ReportType.EmployeeCaseValueBuild:
EmployeeCaseValueReportBuild();
break;
case ReportType.EmployeeCaseValueEnd:
EmployeeCaseValueReportEnd();
break;
case ReportType.CumulativeJournalEnd:
CumulativeJournalReportEnd();
break;
}
//CumulativeJournalReport();
return Tasks.Task.CompletedTask;
}
private void EmployeeCaseValueReportBuild() =>
new ReportBuildFunctionInvoker<EmployeeCaseValues.ReportBuildFunction>(
HttpClient, ScriptConfiguration).Build("EmployeeCaseValues");
private void EmployeeCaseValueReportEnd() =>
new ReportEndFunctionInvoker<EmployeeCaseValues.ReportEndFunction>(
HttpClient, ScriptConfiguration).End("EmployeeCaseValues");
private void CumulativeJournalReportEnd() =>
new ReportEndFunctionInvoker<CumulativeJournal.ReportEndFunction>(
HttpClient, ScriptConfiguration).End("CumulativeJournal");
/// <summary>Program entry point</summary>
static async Tasks.Task Main()
{
// change the working report
currentReport = ReportType.EmployeeCaseValueBuild;
//currentReport = ReportType.EmployeeCaseValueEnd;
//currentReport = ReportType.CumulativeJournalEnd;
Log.SetLogger(new PayrollLog());
using var program = new Program();
await program.ExecuteAsync();
}
}