From 21a359f78d06a25d4a5de0f45507af173abfcc61 Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:29:15 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=20+=20=D0=BD=D0=B0=D1=87=D0=B0=D0=BB=D0=BE=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModel/StudentBindingModel.cs | 14 +++++++++++++ .../BusinessLogicsContracts/IStudentLogic.cs | 15 ++++++++++++++ .../SearchModels/StudentSearchModel.cs | 13 ++++++++++++ .../StorageContracts/IStudentStorage.cs | 16 +++++++++++++++ .../Contracts/ViewModels/StudentViewModel.cs | 20 +++++++++++++++++++ .../DataModels/Models/IAttestationModel.cs | 9 +++++++++ .../{IDiscipline.cs => IDisciplineModel.cs} | 2 +- .../DataModels/Models/IPlanOfStudyModel.cs | 9 +++++++++ .../{IStatement.cs => IStatementModel.cs} | 2 +- .../{IStorekeeper.cs => IStorekeeperModel.cs} | 2 +- University/DataModels/Models/IStudent.cs | 9 --------- University/DataModels/Models/IStudentModel.cs | 11 ++++++++++ .../Models/{ITeacher.cs => ITeacherModel.cs} | 2 +- University/DataModels/Models/IWorkerModel.cs | 6 ++++++ 14 files changed, 117 insertions(+), 13 deletions(-) create mode 100644 University/Contracts/BindingModel/StudentBindingModel.cs create mode 100644 University/Contracts/BusinessLogicsContracts/IStudentLogic.cs create mode 100644 University/Contracts/SearchModels/StudentSearchModel.cs create mode 100644 University/Contracts/StorageContracts/IStudentStorage.cs create mode 100644 University/Contracts/ViewModels/StudentViewModel.cs create mode 100644 University/DataModels/Models/IAttestationModel.cs rename University/DataModels/Models/{IDiscipline.cs => IDisciplineModel.cs} (78%) create mode 100644 University/DataModels/Models/IPlanOfStudyModel.cs rename University/DataModels/Models/{IStatement.cs => IStatementModel.cs} (77%) rename University/DataModels/Models/{IStorekeeper.cs => IStorekeeperModel.cs} (54%) delete mode 100644 University/DataModels/Models/IStudent.cs create mode 100644 University/DataModels/Models/IStudentModel.cs rename University/DataModels/Models/{ITeacher.cs => ITeacherModel.cs} (82%) create mode 100644 University/DataModels/Models/IWorkerModel.cs diff --git a/University/Contracts/BindingModel/StudentBindingModel.cs b/University/Contracts/BindingModel/StudentBindingModel.cs new file mode 100644 index 0000000..7d8b94c --- /dev/null +++ b/University/Contracts/BindingModel/StudentBindingModel.cs @@ -0,0 +1,14 @@ +using University.DataModels.Models; + +namespace University.Contracts.BindingModel +{ + public class StudentBindingModel : IStudentModel + { + public int Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Familia { get; set; } = string.Empty; + public string? Patronomyc { get; set; } + public string PhoneNumber { get; set; } = string.Empty; + public IPlanOfStudyModel? planOfStudy { get; set; } + } +} diff --git a/University/Contracts/BusinessLogicsContracts/IStudentLogic.cs b/University/Contracts/BusinessLogicsContracts/IStudentLogic.cs new file mode 100644 index 0000000..d839c0b --- /dev/null +++ b/University/Contracts/BusinessLogicsContracts/IStudentLogic.cs @@ -0,0 +1,15 @@ +using University.Contracts.BindingModel; +using University.Contracts.SearchModels; +using University.Contracts.ViewModels; + +namespace University.Contracts.BusinessLogicsContracts +{ + public interface IStudentLogic + { + List? ReadList(StudentSearchModel? model); + StudentViewModel? ReadElement(StudentSearchModel model); + bool Create(StudentBindingModel model); + bool Update(StudentBindingModel model); + bool Delete(StudentBindingModel model); + } +} diff --git a/University/Contracts/SearchModels/StudentSearchModel.cs b/University/Contracts/SearchModels/StudentSearchModel.cs new file mode 100644 index 0000000..e466aca --- /dev/null +++ b/University/Contracts/SearchModels/StudentSearchModel.cs @@ -0,0 +1,13 @@ +using University.DataModels.Models; + +namespace University.Contracts.SearchModels +{ + public class StudentSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + public string? Familia { get; set; } + public IPlanOfStudyModel? planOfStudy { get; set; } + + } +} diff --git a/University/Contracts/StorageContracts/IStudentStorage.cs b/University/Contracts/StorageContracts/IStudentStorage.cs new file mode 100644 index 0000000..9211c0e --- /dev/null +++ b/University/Contracts/StorageContracts/IStudentStorage.cs @@ -0,0 +1,16 @@ +using University.Contracts.BindingModel; +using University.Contracts.SearchModels; +using University.Contracts.ViewModels; + +namespace University.Contracts.StorageContracts +{ + public interface IStudentStorage + { + List GetFullList(); + List GetFilteredList(StudentSearchModel model); + StudentViewModel? GetElement(StudentSearchModel model); + StudentViewModel? Insert(StudentBindingModel model); + StudentViewModel? Update(StudentBindingModel model); + StudentViewModel? Delete(StudentBindingModel model); + } +} diff --git a/University/Contracts/ViewModels/StudentViewModel.cs b/University/Contracts/ViewModels/StudentViewModel.cs new file mode 100644 index 0000000..f5979ec --- /dev/null +++ b/University/Contracts/ViewModels/StudentViewModel.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using University.DataModels.Models; + +namespace University.Contracts.ViewModels +{ + public class StudentViewModel : IStudentModel + { + public int Id { get; set; } + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + [DisplayName("Фамилия")] + public string Familia { get; set; } = string.Empty; + [DisplayName("Отчество")] + public string Patronomyc { get; set; } = string.Empty; + [DisplayName("Номер Телефона")] + public string PhoneNumber { get; set; } = string.Empty; + public IPlanOfStudyModel planOfStudy { get; set; } + + } +} diff --git a/University/DataModels/Models/IAttestationModel.cs b/University/DataModels/Models/IAttestationModel.cs new file mode 100644 index 0000000..b6fd4a1 --- /dev/null +++ b/University/DataModels/Models/IAttestationModel.cs @@ -0,0 +1,9 @@ +namespace University.DataModels.Models +{ + public interface IAttestationModel : IId + { + string FormOfEvaluation { get; } + string Score { get; } + IStudentModel Student { get; } + } +} diff --git a/University/DataModels/Models/IDiscipline.cs b/University/DataModels/Models/IDisciplineModel.cs similarity index 78% rename from University/DataModels/Models/IDiscipline.cs rename to University/DataModels/Models/IDisciplineModel.cs index 20517ca..1da99f7 100644 --- a/University/DataModels/Models/IDiscipline.cs +++ b/University/DataModels/Models/IDisciplineModel.cs @@ -1,6 +1,6 @@ namespace University.DataModels.Models { - public interface IDiscipline : IId + public interface IDisciplineModel : IId { int TeacherId { get; } string Name { get; set; } diff --git a/University/DataModels/Models/IPlanOfStudyModel.cs b/University/DataModels/Models/IPlanOfStudyModel.cs new file mode 100644 index 0000000..cde1330 --- /dev/null +++ b/University/DataModels/Models/IPlanOfStudyModel.cs @@ -0,0 +1,9 @@ +namespace University.DataModels.Models +{ + public interface IPlanOfStudyModel : IId + { + string Profile { get; } + string FormOfStudy { get; } + Dictionary Workers { get; } + } +} diff --git a/University/DataModels/Models/IStatement.cs b/University/DataModels/Models/IStatementModel.cs similarity index 77% rename from University/DataModels/Models/IStatement.cs rename to University/DataModels/Models/IStatementModel.cs index 5ef64f8..2b69cf4 100644 --- a/University/DataModels/Models/IStatement.cs +++ b/University/DataModels/Models/IStatementModel.cs @@ -1,6 +1,6 @@ namespace University.DataModels.Models { - public interface IStatement : IId + public interface IStatementModel : IId { int TeacherId { get; } string Name { get; } diff --git a/University/DataModels/Models/IStorekeeper.cs b/University/DataModels/Models/IStorekeeperModel.cs similarity index 54% rename from University/DataModels/Models/IStorekeeper.cs rename to University/DataModels/Models/IStorekeeperModel.cs index 428510f..a6d06da 100644 --- a/University/DataModels/Models/IStorekeeper.cs +++ b/University/DataModels/Models/IStorekeeperModel.cs @@ -1,6 +1,6 @@ namespace University.DataModels.Models { - public interface IStorekeeper : IPerson + public interface IStorekeeperModel : IPerson { } } diff --git a/University/DataModels/Models/IStudent.cs b/University/DataModels/Models/IStudent.cs deleted file mode 100644 index a589534..0000000 --- a/University/DataModels/Models/IStudent.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace University.DataModels.Models -{ - public interface IStudent : IId - { - string Name { get; } - public string PhoneNumber { get; } - Dictionary StudentDisciplines { get; } - } -} diff --git a/University/DataModels/Models/IStudentModel.cs b/University/DataModels/Models/IStudentModel.cs new file mode 100644 index 0000000..fd49eb7 --- /dev/null +++ b/University/DataModels/Models/IStudentModel.cs @@ -0,0 +1,11 @@ +namespace University.DataModels.Models +{ + public interface IStudentModel : IId + { + string Name { get; } + string Familia { get; } + string Patronomyc { get; } + public string PhoneNumber { get; } + IPlanOfStudyModel planOfStudy { get; } + } +} diff --git a/University/DataModels/Models/ITeacher.cs b/University/DataModels/Models/ITeacherModel.cs similarity index 82% rename from University/DataModels/Models/ITeacher.cs rename to University/DataModels/Models/ITeacherModel.cs index 50c59b0..717f2ad 100644 --- a/University/DataModels/Models/ITeacher.cs +++ b/University/DataModels/Models/ITeacherModel.cs @@ -1,6 +1,6 @@ namespace University.DataModels.Models { - public interface ITeacher : IId + public interface ITeacherModel : IId { int StorekeeperId { get; } string Name { get; } diff --git a/University/DataModels/Models/IWorkerModel.cs b/University/DataModels/Models/IWorkerModel.cs new file mode 100644 index 0000000..78a6930 --- /dev/null +++ b/University/DataModels/Models/IWorkerModel.cs @@ -0,0 +1,6 @@ +namespace University.DataModels.Models +{ + public interface IWorkerModel : IPerson + { + } +}