-
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.
Merge pull request #11 from TheKornelM/dev
Filter and show users, class diagrams
- Loading branch information
Showing
19 changed files
with
610 additions
and
40 deletions.
There are no files selected for viewing
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,27 @@ | ||
using SchoolManagerModel.Utils; | ||
|
||
namespace SchoolManagerModel.DTOs; | ||
public class UserDto | ||
{ | ||
public string Username { get; set; } | ||
public string Email { get; set; } | ||
|
||
public string FirstName { get; set; } | ||
|
||
public string LastName { get; set; } | ||
|
||
public string Name => CultureUtils.GetFullName(FirstName, LastName); | ||
|
||
public UserDto() | ||
{ | ||
|
||
} | ||
|
||
public UserDto(string username, string email, string firstName, string lastName) | ||
{ | ||
Username = username; | ||
Email = email; | ||
FirstName = firstName; | ||
LastName = lastName; | ||
} | ||
} |
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
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
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
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,88 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature"> | ||
<Class Name="SchoolManagerModel.Exceptions.ClassExistsException"> | ||
<Position X="10.5" Y="6" Width="4.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Exceptions\ClassExistsException.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.UserModel.Admin"> | ||
<Position X="2.75" Y="3.5" Width="1.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\UserModel\Admin.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.UserModel.Student"> | ||
<Position X="7.25" Y="9.25" Width="3.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAADAEAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\UserModel\Student.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.UserModel.Teacher"> | ||
<Position X="1.75" Y="5.25" Width="1.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\UserModel\Teacher.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.UserModel.User"> | ||
<Position X="4.25" Y="6" Width="5.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAACAEAAACAAAAAAAQAAAAQAAAAAAAACAAAAAAAAAAg=</HashCode> | ||
<FileName>Entities\UserModel\User.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.AssignedSubject"> | ||
<Position X="5" Y="3.25" Width="2.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAACAABAQAAAAAAAAIAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode> | ||
<FileName>Entities\AssignedSubject.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.Class"> | ||
<Position X="4.25" Y="9.25" Width="2.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAACAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\Class.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.Lesson"> | ||
<Position X="11.75" Y="3.5" Width="2.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAACAAAAAAAAAAAAAAAACAQAAAAAAAAABAAAAAAAAAI=</HashCode> | ||
<FileName>Entities\Lesson.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.Mark"> | ||
<Position X="11" Y="8.25" Width="2.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAiAABAQAAAAAAAAIAAAAAAAAAAAAABAAAAAAEAAAA=</HashCode> | ||
<FileName>Entities\Mark.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.RoleRecord"> | ||
<Position X="1.75" Y="8.75" Width="1.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAACAAIAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\RoleRecord.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Entities.Subject"> | ||
<Position X="7.75" Y="3" Width="3.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAECAAAAAAAAAAAAAAIAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\Subject.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Enum Name="SchoolManagerModel.Entities.Role"> | ||
<Position X="2" Y="7" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAEAAAAAQAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Entities\Role.cs</FileName> | ||
</TypeIdentifier> | ||
</Enum> | ||
<Font Name="Segoe UI" Size="9" /> | ||
</ClassDiagram> |
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
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
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,113 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature"> | ||
<Class Name="SchoolManagerModel.Persistence.ClassDatabase" BaseTypeListCollapsed="true"> | ||
<Position X="23.25" Y="14.25" Width="3.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAABAAACAAAABAAAACAAAQAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Persistence\ClassDatabase.cs</FileName> | ||
</TypeIdentifier> | ||
<Lollipop Position="0.2" /> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Persistence.SchoolDbContext"> | ||
<Position X="12" Y="6.25" Width="4.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAQAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Persistence\SchoolDbContext.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Persistence.SchoolDbContextBase"> | ||
<Position X="12" Y="2" Width="4.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAIAAGAAAwEAAAAAAAAAAQAAEgAAAAAAAAQAAgAAAAA=</HashCode> | ||
<FileName>Persistence\SchoolDbContextBase.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Persistence.SubjectDatabase" BaseTypeListCollapsed="true"> | ||
<Position X="7.5" Y="14.75" Width="5.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAABAAAAAABBAAAAAAAAAAAAAAQAEIAAAg=</HashCode> | ||
<FileName>Persistence\SubjectDatabase.cs</FileName> | ||
</TypeIdentifier> | ||
<Lollipop Position="0.2" /> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Persistence.TeacherDatabase" BaseTypeListCollapsed="true"> | ||
<Position X="13.5" Y="14.25" Width="4.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAhAAAAAAAAQAAAAAECAAEAAAAAAAAAAA=</HashCode> | ||
<FileName>Persistence\TeacherDatabase.cs</FileName> | ||
</TypeIdentifier> | ||
<Lollipop Position="0.2" /> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Persistence.UserDatabase" BaseTypeListCollapsed="true"> | ||
<Position X="18.75" Y="15.5" Width="4" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAgAAAFQAAAAgAAEAAAAICAAAIAAAAAAAAQAQAABQA=</HashCode> | ||
<FileName>Persistence\UserDatabase.cs</FileName> | ||
</TypeIdentifier> | ||
<Lollipop Position="0.2" /> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Managers.ClassManager"> | ||
<Position X="23.25" Y="9.5" Width="3.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAABAAACAAAAAAAAACAAAQAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Managers\ClassManager.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Managers.LoginManager"> | ||
<Position X="18" Y="5.75" Width="3.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Managers\LoginManager.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Managers.SubjectManager"> | ||
<Position X="7.5" Y="9" Width="5.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAhAAAAAABAAAAAAAAAAAAABAQAEIAAAA=</HashCode> | ||
<FileName>Managers\SubjectManager.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Managers.TeacherManager"> | ||
<Position X="13.5" Y="10" Width="4.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAIAAAAAAAAAAAA=</HashCode> | ||
<FileName>Managers\TeacherManager.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="SchoolManagerModel.Managers.UserManager"> | ||
<Position X="18.75" Y="8" Width="4" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAVQAAAAAAAEAgAAICAAAIAAAAAAAAQAAgABQA=</HashCode> | ||
<FileName>Managers\UserManager.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Interface Name="SchoolManagerModel.Persistence.IAsyncClassDataHandler"> | ||
<Position X="23.5" Y="12" Width="3.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAABAAACAAAABAAAACAAAQAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Persistence\IAsyncClassDataHandler.cs</FileName> | ||
</TypeIdentifier> | ||
</Interface> | ||
<Interface Name="SchoolManagerModel.Persistence.IAsyncSubjectDataHandler"> | ||
<Position X="8" Y="12" Width="4.75" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAABAAAAAABBAAAAAAAAAAAAAAQAEIAAAg=</HashCode> | ||
<FileName>Persistence\IAsyncSubjectDataHandler.cs</FileName> | ||
</TypeIdentifier> | ||
</Interface> | ||
<Interface Name="SchoolManagerModel.Persistence.IAsyncTeacherDataHandler"> | ||
<Position X="13.75" Y="12" Width="4.25" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAhAAAAAAAAQAAAAAEAAAEAAAAAAAAAAA=</HashCode> | ||
<FileName>Persistence\IAsyncTeacherDataHandler.cs</FileName> | ||
</TypeIdentifier> | ||
</Interface> | ||
<Interface Name="SchoolManagerModel.Persistence.IAsyncUserDataHandler"> | ||
<Position X="19" Y="11.75" Width="3.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAgAAAFQAAAAgAAEAAAAICAAAIAAAAAAAAQAQAABQA=</HashCode> | ||
<FileName>Persistence\IAsyncUserDataHandler.cs</FileName> | ||
</TypeIdentifier> | ||
</Interface> | ||
<Font Name="Segoe UI" Size="9" /> | ||
</ClassDiagram> |
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
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using SchoolManagerModel.Entities; | ||
using SchoolManagerModel.Entities.UserModel; | ||
using SchoolManagerModel.Utils; | ||
|
||
namespace SchoolManagerModel.Persistence; | ||
|
@@ -14,19 +12,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
// Change password after first run! | ||
var admin = new User("admin", HashStringMd5.GetHashedString("admin"), "[email protected]", "firstName", | ||
"secondName") | ||
{ | ||
Id = 1 | ||
}; | ||
modelBuilder.Entity<User>().HasData(admin); | ||
|
||
// Assign administrator role to default account | ||
var adminRole = new RoleRecord(1, 2) | ||
{ | ||
Id = 1 | ||
}; | ||
modelBuilder.Entity<RoleRecord>().HasData(adminRole); | ||
var seeder = new EntityDataSeeder(modelBuilder); | ||
seeder.SeedAllData(); | ||
} | ||
} |
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
Oops, something went wrong.