Lab 1 (15 min)

This commit is contained in:
artemkudinov14 2024-11-21 16:41:12 +04:00
parent b5b8354217
commit 86a76e53f2
15 changed files with 242 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,19 @@
namespace YourNamespace.Entities
{
public class Discipline
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public int Estimation { get; private set; }
public static Discipline CreateDiscipline(int id, string name, int estimation)
{
return new Discipline
{
Id = id,
Name = name,
Estimation = estimation
};
}
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities.Enums;
public enum DisciplineName
{
OTP = 1,
OOP = 2,
PI = 3,
VM = 4,
OAIP = 5
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities.Enums;
public enum TeacherName
{
Kuleshov = 1,
Skalkin = 2,
Ankilov = 3,
Voronina = 4,
Surkova = 5,
Egov = 6
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities;
public class Statament
{
public int Id { get; private set; }
public int TeacherID { get; private set; }
public int Discipline { get; private set; }
public string Date { get; private set; } = string.Empty;
public static Statament CreateStatament(int id, int teacherID, int discoplineID, string date)
{
return new Statament
{
Id = id,
TeacherID = teacherID,
Discipline = discoplineID,
Date = date
};
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities;
public class Student
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public string FamilyStatus { get; private set; } = string.Empty;
public bool Dormitory { get; private set; }
public static Student CreateStudent(int id, string name, string familyStatus, bool dormitory)
{
return new Student
{
Id = id,
Name = name,
FamilyStatus = familyStatus,
Dormitory = dormitory,
};
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities;
public class Student_Statament
{
public int StudentId { get; private set; }
public int StatamentID { get; private set; }
public static Student_Statament CreateStudent_Statament(int studentId, int statamentID)
{
return new Student_Statament
{
StudentId = studentId,
StatamentID = statamentID
};
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities;
public class Sumbission
{
public int Id { get; private set; }
public int StudentId { get; private set; }
public int DisciplineID { get; private set; }
public string Date { get; private set; } = string.Empty;
public static Sumbission CreateSumbission(int id, int studentID, int disciplineID, string date)
{
return new Sumbission
{
Id = id,
Date = date,
DisciplineID = disciplineID ,
StudentId = studentID
};
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Entities;
public class Teacher
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public DateTime Date { get; private set; }
public static Teacher CreateTeacher(int id, string name, DateTime date)
{
return new Teacher
{
Id = id,
Name = name,
Date = date
};
}
}

View File

@ -0,0 +1,17 @@
using ProjectSession.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Repositories;
public interface IDisciplineRepository
{
IEnumerable<Discipline> ReadDiscipline();
Discipline ReadDisciplineID(int id);
void CreateDiscipline(Discipline teacher);
void UpdateDiscipline(Discipline teacher);
void DeleteDiscipline(int id);
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Repositories;
public interface IStatamentRepository
{
IEnumerable<Statament> ReadStataments(DateTime? dateForm = null, DateTime? dateTo = null, int? teacherID = null, int? discoplineID, int? )
}

View File

@ -0,0 +1,19 @@
using ProjectSession.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Repositories;
public interface IStudentRepository
{
IEnumerable<Student> ReadStudent();
Student ReadStudentID(int id);
void CreateStudent(Student student);
void UpdateStudent(Student student);
void DeleteStident(int id);
}

View File

@ -0,0 +1,17 @@
using ProjectSession.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectSession.Repositories;
public interface ITeacherRepository
{
IEnumerable<Teacher> ReadTeacher();
Teacher ReadTeacherID(int id);
void CreateTeacher(Teacher teacher);
void UpdateTeacher(Teacher teacher);
void DeleteTeacher(int id);
}