-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (54 loc) · 1.96 KB
/
Program.cs
File metadata and controls
63 lines (54 loc) · 1.96 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
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DateTransformationTable
{
class Program
{
static void Main(string[] args)
{
bool run = true;
while (run)
{
Console.WriteLine("Date Transformation Table Creation\n\n");
Console.Write("Enter Start Year: ");
int sYear, eYear, tType;
while (!int.TryParse(Console.ReadLine(), out sYear))
{
Console.Write("\n Enter Start Year: ");
}
Console.Write("Enter End Year: ");
while (!int.TryParse(Console.ReadLine(), out eYear))
{
Console.Write("\n Enter End Year: ");
}
Console.Write("Enter Transformation Type: \n");
Console.Write("\t1 = Month\n");
Console.Write("\t2 = Quarter \n");
Console.Write("\t3 = Year to Date\n");
Console.Write("Type (1-3): ");
while (!int.TryParse(Console.ReadLine(), out tType))
{
Console.Write("\nPlease enter transformation type (1-3): ");
}
Console.Write("Please enter the file write location: ");
string path = Console.ReadLine();
DateTransformationFunctions dtf = new DateTransformationFunctions(sYear, eYear, (DateTransformationFunctions.TranformationType)tType, path);
dtf.WriteTableToCSVFile();
Console.Write("Write Another File (Y/N): ");
string result = Console.ReadLine();
if (result.ToLower() == "n")
{
run = false;
}
else
{
Console.Clear();
}
}
}
}
}