-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
45 lines (40 loc) · 1.38 KB
/
Program.cs
File metadata and controls
45 lines (40 loc) · 1.38 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
class Program
{
static public void Main(string[] args)
{
var taskmanager = new TaskManager();
if (args.Length == 0)
{
Console.WriteLine("ToDo app\nUsage: list , add , done , delete");
}
else
{
switch (args[0].ToLower())
{
case "add":
Console.Write("Enter the description of the task : ");
string desc = Console.ReadLine() ?? "";
desc = string.IsNullOrEmpty(desc) ? "null" : desc;
//Console.WriteLine(desc);
taskmanager.Add(desc);
break;
case "list":
taskmanager.List();
break;
case "done":
Console.Write("Enter the Id of the completed task : ");
int done_id = Convert.ToInt32(Console.ReadLine());
taskmanager.Done(done_id);
break;
case "delete":
Console.Write("Enter the Id of the task to be deleted : ");
int del_id = Convert.ToInt32(Console.ReadLine());
taskmanager.Delete(del_id);
break;
default:
Console.WriteLine("Unknown Comand");
break;
}
}
}
}