Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email field for student in the complete UI #27

Merged
merged 2 commits into from
Mar 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions MarkMe.Core/DTOs/StudentDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class StudentDTO
public string RegistrationNo { get; set; }
public string Session { get; set; }
public string Section { get; set; }
public string Email { get; set; }
}
public class CreateStudentDTO
{
Expand All @@ -26,5 +27,6 @@ public class CreateStudentDTO
public string RegistrationNo { get; set; }
public string Session { get; set; }
public string Section { get; set; }
public string Email { get; set; }
}
}
2 changes: 1 addition & 1 deletion MarkMe.Core/Repositories/StudentRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FROM ClassRepresentatives
UPDATE Students
SET
CollegeRollNo = @CollegeRollNo, UniversityRollNo = @UniversityRollNo, RegistrationNo = @RegistrationNo,
FirstName = @FirstName, LastName = @LastName, Session = @Session, Section = @Section
FirstName = @FirstName, LastName = @LastName, Session = @Session, Section = @Section, Email = @Email
WHERE StudentId = @StudentId;

SELECT * FROM Students WHERE StudentId = @StudentId
Expand Down
176 changes: 95 additions & 81 deletions MarkMe.Database/AppDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070982",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -65,6 +66,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070943",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -76,6 +78,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070944",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -87,6 +90,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070945",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -109,6 +113,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070947",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -120,6 +125,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070948",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -131,6 +137,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070949",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -142,6 +149,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070950",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -153,6 +161,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070951",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -164,6 +173,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070952",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -175,6 +185,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070953",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -186,6 +197,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070954",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -197,6 +209,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070955",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
new Student() {
Expand All @@ -208,6 +221,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
UniversityRollNo="070956",
Section="G1",
Session="20212025",
Email = "[email protected]",
IsDeleted = false
},
});
Expand Down Expand Up @@ -305,87 +319,87 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
}
});

// Class Representatives
modelBuilder.Entity<ClassRepresentative>().HasData(new[]
{
new ClassRepresentative
{
StudentId = 1,
CourseId = 1,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 2,
CourseId = 2,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 2,
CourseId = 1,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 2,
CourseId = 3,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 2,
CourseId = 4,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 2,
CourseId = 5,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 3,
CourseId = 3,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 4,
CourseId = 4,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 5,
CourseId = 5,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 6,
CourseId = 1,
NominatedBy = 1,
IsDeleted = 0
},
new ClassRepresentative
{
StudentId = 7,
CourseId = 2,
NominatedBy = 1,
IsDeleted = 0,
}
});
//// Class Representatives
//modelBuilder.Entity<ClassRepresentative>().HasData(new[]
//{
// new ClassRepresentative
// {
// StudentId = 1,
// CourseId = 1,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 2,
// CourseId = 2,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 2,
// CourseId = 1,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 2,
// CourseId = 3,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 2,
// CourseId = 4,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 2,
// CourseId = 5,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 3,
// CourseId = 3,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 4,
// CourseId = 4,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 5,
// CourseId = 5,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 6,
// CourseId = 1,
// NominatedBy = 1,
// IsDeleted = 0
// },
// new ClassRepresentative
// {
// StudentId = 7,
// CourseId = 2,
// NominatedBy = 1,
// IsDeleted = 0,
// }
//});

// Activities
modelBuilder.Entity<Activity>().HasData(new[]
Expand Down
3 changes: 3 additions & 0 deletions MarkMe.Database/Entities/Student.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class Student
[StringLength(50)]
public string LastName { get; set; } = string.Empty;

[EmailAddress]
public string Email { get; set; } = string.Empty;

[StringLength(9, ErrorMessage = "Session cannot be longer than 9 characters.")]
public string Session { get; set; } = string.Empty;

Expand Down
Loading