60 ghjwtynjd hf,jns

This commit is contained in:
Сафия Мухамадиева 2024-12-19 04:14:24 +04:00
parent a27c78524c
commit e0f64dbfae
12 changed files with 121 additions and 113 deletions

View File

@ -0,0 +1,11 @@
namespace StudentProgress.Entities.Enums;
[Flags]
public enum Course
{
None,
First = 1, // 1 курс
Second = 2, // 2 курс
Third = 4, // 3 курс
Fourth = 8 // 4 курс
}

View File

@ -1,9 +0,0 @@
namespace StudentProgress.Entities.Enums;
public enum DisLectE
{
None = 0,
Praktika = 1,
Lecturer = 2,
Labaratory = 3
}

View File

@ -8,10 +8,10 @@ namespace StudentProgress.Entities.Enums;
public enum Grade public enum Grade
{ {
None = 0, //пересдача None,
Two = 1, One = 1,
Three = 2, Two = 2,
Four = 3, Three = 3,
Five = 4, Four = 4,
Zachet = 5 Five = 5,
} }

View File

@ -1,10 +0,0 @@
namespace StudentProgress.Entities.Enums;
[Flags]
public enum TypeOfWork
{
None = 0, //неизвестная работа
Exam = 1,
Zachet = 2,
Referat = 4,
Laba = 8,
}

View File

@ -6,15 +6,28 @@ public class Grades
public int SubjectsId { get; private set; } public int SubjectsId { get; private set; }
public int ProfessorsId { get; private set; } public int ProfessorsId { get; private set; }
public DateTime Date { get; private set; } public DateTime Date { get; private set; }
public IEnumerable<StudentGrades> StudentGrade { get; private set; } = [];
public static Grades CreateEntity(int id, int subjectsId, int professorsId, DateTime date) public static Grades CreateEntity(int id, int subjectsId, int professorsId, DateTime date, IEnumerable<StudentGrades> studentGrades)
{ {
return new Grades return new Grades
{ {
Id = id, Id = id,
SubjectsId = subjectsId, SubjectsId = subjectsId,
ProfessorsId = professorsId, ProfessorsId = professorsId,
Date = date Date = date,
StudentGrade = studentGrades
};
}
public static Grades CreateEntity(TempStudentGrades tempStudentGrades, IEnumerable<StudentGrades> studentGrades)
{
return new Grades
{
Id = tempStudentGrades.Id,
SubjectsId = tempStudentGrades.SubjectsId,
ProfessorsId = tempStudentGrades.ProfessorsId,
Date = tempStudentGrades.Date,
StudentGrade = studentGrades
}; };
} }
} }

View File

@ -1,17 +1,16 @@
namespace StudentProgress.Entities namespace StudentProgress.Entities;
{
public class Group
{
public int Id { get; private set; }
public string NameGroup { get; set; } = string.Empty;
public static Group CreateEntity(int id, string nameGroup) public class Group
{
public int Id { get; private set; }
public string NameGroup { get; set; } = string.Empty;
public static Group CreateEntity(int id, string nameGroup)
{
return new Group
{ {
return new Group Id = id,
{ NameGroup = nameGroup ?? string.Empty
Id = id, };
NameGroup = nameGroup ?? string.Empty
};
}
} }
} }

View File

@ -1,35 +1,19 @@
namespace StudentProgress.Entities namespace StudentProgress.Entities;
public class Lectures
{ {
public class Lectures public int Id { get; private set; }
public int ProfessorsId { get; private set; }
public DateTime Date { get; private set; }
public string Auditorium { get; private set; } = string.Empty;
public static Lectures CreateElement(int id, int professorsId, DateTime date, string auditorium)
{ {
public int LectureId { get; private set; } return new Lectures
public int ProfessorsId { get; private set; }
public DateTime Date { get; private set; }
public string Auditorium { get; private set; }
public Lectures()
{ {
Auditorium = string.Empty; // Инициализация свойства Auditorium Id = id,
} Date = date,
Auditorium = auditorium,
public void SetProfessorsId(int professorsId) ProfessorsId = professorsId,
{ };
ProfessorsId = professorsId;
}
public void SetDate(DateTime date)
{
Date = date;
}
public void SetLectureId(int lectureId)
{
LectureId = lectureId;
}
public void SetAuditorium(string auditorium)
{
Auditorium = auditorium;
}
} }
} }

View File

@ -3,15 +3,15 @@
public class Professors public class Professors
{ {
public int Id { get; set; } public int Id { get; set; }
public string FirstNameProfessor { get; set; } = string.Empty; public string FirstName { get; set; } = string.Empty;
public string SurnameProfessor { get; set; } = string.Empty; public string Surname { get; set; } = string.Empty;
public static Professors CreateEntity(int id, string firstName, string SurnameProfessor) public static Professors CreateEntity(int id, string firstName, string surname)
{ {
return new Professors return new Professors
{ {
Id = id, Id = id,
FirstNameProfessor = firstName ?? string.Empty, FirstName = firstName ?? string.Empty,
SurnameProfessor = SurnameProfessor ?? string.Empty Surname = surname ?? string.Empty
}; };
} }
} }

View File

@ -1,21 +1,20 @@
namespace StudentProgress.Entities namespace StudentProgress.Entities;
{
public class Student
{
public int Id { get; private set; }
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public int GroupId { get; set; }
public static Student CreateEntity(int id, string name, string surname, int groupId) public class Student
{
public int Id { get; private set; }
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public int GroupId { get; set; }
public static Student CreateEntity(int id, string name, string surname, int groupId)
{
return new Student
{ {
return new Student Id = id,
{ Name = name ?? string.Empty,
Id = id, Surname = surname ?? string.Empty,
Name = name ?? string.Empty, GroupId = groupId
Surname = surname ?? string.Empty, };
GroupId = groupId
};
}
} }
} }

View File

@ -1,17 +1,20 @@
namespace StudentProgress.Entities; using Microsoft.VisualBasic.Devices;
using StudentProgress.Entities.Enums;
namespace StudentProgress.Entities;
public class Subjects public class Subjects
{ {
public int Id { get; private set; } public int Id { get; private set; }
public string NameSubject { get; private set; } = string.Empty; public string NameSubject { get; private set; } = string.Empty;
public Course Course { get; private set; }
public static Subjects CreateEntity_(int id, string nameSubject) public static Subjects CreateEntity_(int id, string nameSubject, Course course)
{ {
return new Subjects return new Subjects
{ {
Id = id, Id = id,
NameSubject = nameSubject ?? string.Empty, NameSubject = nameSubject ?? string.Empty,
Course = course
}; };
} }
} }

View File

@ -0,0 +1,18 @@
using StudentProgress.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StudentProgress.Entities;
public class TempStudentGrades
{
public int Id { get; private set; }
public int SubjectsId { get; private set; }
public int ProfessorsId { get; private set; }
public DateTime Date { get; private set; }
public int StudentID { get; private set; }
public Grade Grade { get; private set; }
}

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // Этот код создан программой.
// Runtime Version:4.0.30319.42000 // Исполняемая версия:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// the code is regenerated. // повторной генерации кода.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -13,12 +13,12 @@ namespace StudentProgress.Properties {
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // Этот класс создан автоматически классом StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // с помощью такого средства, как ResGen или Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// with the /str option, or rebuild your VS project. // с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@ -33,7 +33,7 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
@ -47,8 +47,8 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// resource lookups using this strongly typed resource class. /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
@ -61,7 +61,7 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap Add { internal static System.Drawing.Bitmap Add {
get { get {
@ -71,7 +71,7 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap BackGround { internal static System.Drawing.Bitmap BackGround {
get { get {
@ -81,7 +81,7 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap Del { internal static System.Drawing.Bitmap Del {
get { get {
@ -91,7 +91,7 @@ namespace StudentProgress.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap Pencil { internal static System.Drawing.Bitmap Pencil {
get { get {