-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2d1a2d
commit c8df49a
Showing
24 changed files
with
438 additions
and
366 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
AttendanceSystem/.vs/AttendanceSystem/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file removed
BIN
-26.7 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/56165b48-9206-4062-ad2a-3ba758212d8d.vsidx
Binary file not shown.
Binary file renamed
BIN
+32.5 KB
...e554d8a-bbe8-4c48-aeef-28e305e00765.vsidx → ...ece4978-e3f6-4e89-bfa3-235ce0aaca05.vsidx
Binary file not shown.
Binary file removed
BIN
-28.3 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/8ab7a186-7b5a-4b47-ae20-e6bc25025773.vsidx
Binary file not shown.
Binary file added
BIN
+26.9 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/9362dc03-7b92-498f-8194-211b1c4dab9e.vsidx
Binary file not shown.
Binary file added
BIN
+28.4 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/cab1401d-f7eb-49d5-9a78-bf62e1cd52ce.vsidx
Binary file not shown.
Binary file added
BIN
+27.6 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/ddad04ed-4d27-4806-82eb-eaf5701175a9.vsidx
Binary file not shown.
Binary file removed
BIN
-26.5 KB
...ceSystem/.vs/AttendanceSystem/FileContentIndex/ed40048e-4608-4c10-8e0c-0f26c5ce3dbe.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+30 Bytes
(100%)
AttendanceSystem/.vs/ProjectEvaluation/attendancesystem.metadata.v5.2
Binary file not shown.
Binary file modified
BIN
+87.2 KB
(100%)
AttendanceSystem/.vs/ProjectEvaluation/attendancesystem.projects.v5.2
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
using AttendanceSystem.HomePages; | ||
using AttendanceSystem.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AttendanceSystem | ||
{ | ||
public class Bootstrap | ||
{ | ||
private static readonly AttendanceSystemDbContext db = new AttendanceSystemDbContext(); | ||
public static void ApplicationStart() | ||
{ | ||
while (true) | ||
{ | ||
int choice = 0; | ||
string userName = ""; | ||
string password = ""; | ||
|
||
Console.Write("Options: "); | ||
Console.Write("\n1. Admin Login\n2. Teacher Login\n3. Student Login\nEnter option: "); | ||
choice = int.Parse(Console.ReadLine()); | ||
|
||
switch (choice) | ||
{ | ||
case 1: | ||
Console.WriteLine(); | ||
Console.Write("\nEnter User Name: "); | ||
userName = Console.ReadLine(); | ||
Console.Write("Enter Password: "); | ||
password = Console.ReadLine(); | ||
|
||
if (userName != string.Empty && password != string.Empty) | ||
{ | ||
Admin a1 = Bootstrap.db.Admins.Where(x => x.UserName == userName && x.Password == password).FirstOrDefault(); | ||
if (a1 != null) | ||
AdminPage.AdminOption(a1); | ||
else | ||
Console.WriteLine("Wrong Username and Password"); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Input can not be empty. Please enter a valid Username & Password"); | ||
} | ||
|
||
break; | ||
|
||
case 2: | ||
Console.WriteLine(); | ||
Console.Write("\nEnter User Name: "); | ||
userName = Console.ReadLine(); | ||
Console.Write("Enter Password: "); | ||
password = Console.ReadLine(); | ||
|
||
if (userName != string.Empty && password != string.Empty) | ||
{ | ||
Teacher a1 = Bootstrap.db.Teachers.Where(x => x.UserName == userName && x.Password == password).FirstOrDefault(); | ||
if (a1 != null) | ||
TeacherPage.TeacherOption(a1); | ||
else | ||
Console.WriteLine("Wrong Username and Password"); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Input can not be empty. Please enter a valid Username & Password"); | ||
} | ||
|
||
break; | ||
|
||
case 3: | ||
Console.WriteLine(); | ||
Console.Write("\nEnter User Name: "); | ||
userName = Console.ReadLine(); | ||
Console.Write("Enter Password: "); | ||
password = Console.ReadLine(); | ||
|
||
if (userName != string.Empty && password != string.Empty) | ||
{ | ||
Student s1 = Bootstrap.db.Students.Where(x => x.UserName == userName && x.Password == password).FirstOrDefault(); | ||
if (s1 != null) | ||
StudentPage.StudentOption(s1); | ||
else | ||
Console.WriteLine("Wrong Username and Password"); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Input can not be empty. Please enter a valid Username & Password"); | ||
} | ||
|
||
break; | ||
|
||
default: | ||
Console.WriteLine("Invalid Input!!"); | ||
Console.WriteLine(); | ||
break; | ||
} | ||
} | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.