-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathProgram.cs
More file actions
60 lines (55 loc) · 2.05 KB
/
Program.cs
File metadata and controls
60 lines (55 loc) · 2.05 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
using System;
namespace DatabaseConnection
{
internal class Program
{
static void Main(string[] args)
{
DatabaseConnection databaseConnection = new DatabaseConnection();
//databaseConnection.CreateTable();
//databaseConnection.InsertData();
Console.WriteLine("\n------------------------");
Console.WriteLine("\tMenu");
Console.WriteLine("Press: ");
Console.WriteLine("1. Reading All Data.");
Console.WriteLine("2. Reading Data by User ID.");
Console.WriteLine("3. Updating Data by User ID.");
Console.WriteLine("4. Deleting Data by User ID.");
Console.WriteLine("5. Exit");
Console.WriteLine("------------------------\n");
int choice;
do {
Console.Write("\nEnter your choice: ");
choice = Convert.ToInt32(Console.ReadLine());
switch (choice)
{
case 1:
databaseConnection.GetAllData();
break;
case 2:
databaseConnection.GetDataById();
break;
case 3:
databaseConnection.UpdateData();
break;
case 4:
databaseConnection.DeleteData();
break;
case 5:
Console.Write("Exiting");
for (int i = 0; i < 3; i++)
{
// time delay
System.Threading.Thread.Sleep(500);
Console.Write(".");
}
Console.WriteLine();
break;
default:
Console.WriteLine("Please select the provided options.");
break;
}
} while (choice != 5);
}
}
}