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 + { + } +}