Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/SchoolRegister.Web/bin/Debug/net6.0/SchoolRegister.Web.dll",
"args": [],
"cwd": "${workspaceFolder}/SchoolRegister.Web",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/SchoolRegister.Web/SchoolRegister.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/SchoolRegister.Web/SchoolRegister.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/SchoolRegister.Web/SchoolRegister.Web.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
5 changes: 5 additions & 0 deletions SchoolRegister.DAL/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SchoolRegister.DAL;
public class Class1
{

}
13 changes: 13 additions & 0 deletions SchoolRegister.DAL/SchoolRegister.DAL.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SchoolRegister.Model\SchoolRegister.Model.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions SchoolRegister.Model/DataModels/Grade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Grade
{
public DateTime DateofIssue {get; set;} = default!;
public GradeScale GradeValue {get; set;} = default!;
public Subject Subject {get; set;} = default!;
public int SubjectId {get; set;} = default!;
public int StudentId {get; set;} = default!;
public Student Student {get; set;} = default!;
}
}
13 changes: 13 additions & 0 deletions SchoolRegister.Model/DataModels/GradeScale.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public enum GradeScale
{
NDST = 2,
DST = 3,
DB = 4,
BDB = 5,
}
}
13 changes: 13 additions & 0 deletions SchoolRegister.Model/DataModels/Group.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Group
{
public int Id {get; set;} = default!;
public string Name {get; set;} = default!;
public IList<Student> Students {get; set;} = default!;
public IList<SubjectGroup> SubjectGroups {get; set;} = default!;
}
}
11 changes: 11 additions & 0 deletions SchoolRegister.Model/DataModels/Parent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Parent : User
{
public IList<Student> Student {get; set;} = default!;
}

}
15 changes: 15 additions & 0 deletions SchoolRegister.Model/DataModels/Role.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Role : IdentityRole<int>
{
public RoleValue RoleValue {get; set;} = default;

public Role(String name , RoleValue roleValue){
this.RoleValue = roleValue;
this.Name = name;
}
}
}
14 changes: 14 additions & 0 deletions SchoolRegister.Model/DataModels/RoleValue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public enum RoleValue
{
User = 0,
Student = 1,
Parent = 2,
Teacher = 3,
Admin = 4
}
}
16 changes: 16 additions & 0 deletions SchoolRegister.Model/DataModels/Student.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Student : User
{
public Group Group {get; set;} = default!;
public int? GroupId {get; set;} = default!;
public Parent Parent {get; set;} = default!;
public int? ParentId {get; set;} = default!;
public double AverageGrade {get;} = default!;
public IDictionary<string, double> AverageGradeperSubject {get;} = default!;
public IDictionary<string, List<GradeScale>>Grades {get;} =default!;
}
}
17 changes: 17 additions & 0 deletions SchoolRegister.Model/DataModels/Subject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class Subject
{
public int Id {get; set;} = default!;
public string Name {get; set;} = default!;
public string Description {get; set;} = default!;
public IList<SubjectGroup> SubjectGroups {get; set;} = default!;
public Teacher Teacher {get; set;} = default!;
public int? TeacherId {get; set;} = default!;
public IList<Grade>Grades {get; set;} =default!;

}
}
13 changes: 13 additions & 0 deletions SchoolRegister.Model/DataModels/SubjectGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Identity;
using System;

namespace SchoolRegister.Model.DataModels
{
public class SubjectGroup
{
public Subject Subject {get; set;} = default!;
public int SubjectId {get; set;} = default!;
public Group Group {get; set;} = default!;
public int GroupId {get; set;} = default!;
}
}
14 changes: 14 additions & 0 deletions SchoolRegister.Model/DataModels/Teacher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Identity;
using System;


namespace SchoolRegister.Model.DataModels
{
public class Teacher : User
{
public IList<Subject> Subjects {get; set;} = default!;
public string Title {get; set;} = default!;

}

}
11 changes: 11 additions & 0 deletions SchoolRegister.Model/DataModels/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Identity;
using System;
namespace SchoolRegister.Model.DataModels
{
public class User :IdentityUser<int>
{
public string FirstName { get; set; } = default!;
public string LastName { get; set; } = default!;
public DateTime RegistrationDate { get; set; }
}
}
12 changes: 12 additions & 0 deletions SchoolRegister.Model/SchoolRegister.Model.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="6.0.9" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions SchoolRegister.Services/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SchoolRegister.Services;
public class Class1
{

}
15 changes: 15 additions & 0 deletions SchoolRegister.Services/SchoolRegister.Services.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SchoolRegister.Model\SchoolRegister.Model.csproj" />
<ProjectReference Include="..\SchoolRegister.DAL\SchoolRegister.DAL.csproj" />
<ProjectReference Include="..\SchoolRegister.ViewModels\SchoolRegister.ViewModels.csproj" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions SchoolRegister.ViewModels/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SchoolRegister.ViewModels;
public class Class1
{

}
13 changes: 13 additions & 0 deletions SchoolRegister.ViewModels/SchoolRegister.ViewModels.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SchoolRegister.Model\SchoolRegister.Model.csproj" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions SchoolRegister.Web/Areas/Identity/Pages/_ViewStart.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@{
Layout = "/Views/Shared/_Layout.cshtml";
}
31 changes: 31 additions & 0 deletions SchoolRegister.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using SchoolRegister.Web.Models;

namespace SchoolRegister.Web.Controllers;

public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;

public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}

public IActionResult Index()
{
return View();
}

public IActionResult Privacy()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
12 changes: 12 additions & 0 deletions SchoolRegister.Web/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace SchoolRegister.Web.Data;

public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
}
Loading