From 37070beac2de139004332c6bbcf1a06d17bd97db Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:03:41 +0400 Subject: [PATCH 01/13] add dictionaries in models --- .../UniversityContracts/BindingModels/StatementBindingModel.cs | 1 + .../UniversityContracts/BindingModels/StudentBindingModel.cs | 1 + University/UniversityContracts/ViewModels/StatementViewModel.cs | 1 + University/UniversityContracts/ViewModels/StudentViewModel.cs | 1 + University/UniversityDataModels/Models/IStatementModel.cs | 1 + University/UniversityDataModels/Models/IStudentModel.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/University/UniversityContracts/BindingModels/StatementBindingModel.cs b/University/UniversityContracts/BindingModels/StatementBindingModel.cs index 7cf9d4f..d584937 100644 --- a/University/UniversityContracts/BindingModels/StatementBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StatementBindingModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); public int HoursCount { get; set; } + public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/BindingModels/StudentBindingModel.cs b/University/UniversityContracts/BindingModels/StudentBindingModel.cs index 03cf631..26869e3 100644 --- a/University/UniversityContracts/BindingModels/StudentBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StudentBindingModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; + public Dictionary Results { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/StatementViewModel.cs b/University/UniversityContracts/ViewModels/StatementViewModel.cs index 728fb53..b3ded91 100644 --- a/University/UniversityContracts/ViewModels/StatementViewModel.cs +++ b/University/UniversityContracts/ViewModels/StatementViewModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); public int HoursCount { get; set; } + public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/StudentViewModel.cs b/University/UniversityContracts/ViewModels/StudentViewModel.cs index 2ff6158..141b33e 100644 --- a/University/UniversityContracts/ViewModels/StudentViewModel.cs +++ b/University/UniversityContracts/ViewModels/StudentViewModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; + public Dictionary Results { get; set; } = new(); } } diff --git a/University/UniversityDataModels/Models/IStatementModel.cs b/University/UniversityDataModels/Models/IStatementModel.cs index 681f016..6188a75 100644 --- a/University/UniversityDataModels/Models/IStatementModel.cs +++ b/University/UniversityDataModels/Models/IStatementModel.cs @@ -4,5 +4,6 @@ { DateTime Date { get; } int HoursCount { get; } + Dictionary Students { get; } } } diff --git a/University/UniversityDataModels/Models/IStudentModel.cs b/University/UniversityDataModels/Models/IStudentModel.cs index 2ee8691..ce5db79 100644 --- a/University/UniversityDataModels/Models/IStudentModel.cs +++ b/University/UniversityDataModels/Models/IStudentModel.cs @@ -4,5 +4,6 @@ { String Name { get; } String RecordCardNumber { get; } + Dictionary Results { get; } } } From 8540b924da616fc51559c50840a64e68b77f8139 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 16:44:04 +0400 Subject: [PATCH 02/13] delete useless using --- University/UniversityDataModels/Enums/MarkType.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/University/UniversityDataModels/Enums/MarkType.cs b/University/UniversityDataModels/Enums/MarkType.cs index 6ad9982..a4180f8 100644 --- a/University/UniversityDataModels/Enums/MarkType.cs +++ b/University/UniversityDataModels/Enums/MarkType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace UniversityDataModels.Enums +namespace UniversityDataModels.Enums { public enum MarkType { From a424c0708e0116d729c13020bb12686ad1d9111b Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 16:44:15 +0400 Subject: [PATCH 03/13] add user models --- .../BindingModels/UserBindingModel.cs | 14 ++++++++++++++ .../BuisnessLogicContracts/IUserLogic.cs | 15 +++++++++++++++ .../SearchModels/UserSearchModel.cs | 9 +++++++++ .../StoragesContracts/IUserStorage.cs | 16 ++++++++++++++++ .../ViewModels/UserViewModel.cs | 14 ++++++++++++++ .../UniversityDataModels/Models/IUserModel.cs | 18 ++++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 University/UniversityContracts/BindingModels/UserBindingModel.cs create mode 100644 University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs create mode 100644 University/UniversityContracts/SearchModels/UserSearchModel.cs create mode 100644 University/UniversityContracts/StoragesContracts/IUserStorage.cs create mode 100644 University/UniversityContracts/ViewModels/UserViewModel.cs create mode 100644 University/UniversityDataModels/Models/IUserModel.cs diff --git a/University/UniversityContracts/BindingModels/UserBindingModel.cs b/University/UniversityContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..9b144d7 --- /dev/null +++ b/University/UniversityContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,14 @@ +using UniversityDataModels.Models; +namespace UniversityContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Surname { get; set; } = String.Empty; + public string PhoneNumber { get; set; } = String.Empty; + public string Position { get; set; } = String.Empty; + public string Login { get; set; } = String.Empty; + public string Password { get; set; } = String.Empty; + } +} diff --git a/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs b/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs new file mode 100644 index 0000000..218c1df --- /dev/null +++ b/University/UniversityContracts/BuisnessLogicContracts/IUserLogic.cs @@ -0,0 +1,15 @@ +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; + +namespace UniversityContracts.BuisnessLogicContracts +{ + public interface IUserLogic + { + List? ReadList(UserSearchModel? model); + UserViewModel? ReadElement(UserSearchModel model); + bool Create(UserBindingModel model); + bool Update(UserBindingModel model); + bool Delete(UserBindingModel model); + } +} diff --git a/University/UniversityContracts/SearchModels/UserSearchModel.cs b/University/UniversityContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..83bd13e --- /dev/null +++ b/University/UniversityContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,9 @@ +namespace UniversityContracts.SearchModels +{ + public class UserSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + public string? Password { get; set; } + } +} diff --git a/University/UniversityContracts/StoragesContracts/IUserStorage.cs b/University/UniversityContracts/StoragesContracts/IUserStorage.cs new file mode 100644 index 0000000..574c780 --- /dev/null +++ b/University/UniversityContracts/StoragesContracts/IUserStorage.cs @@ -0,0 +1,16 @@ +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; + +namespace UniversityContracts.StoragesContracts +{ + public interface IUserStorage + { + List GetFullList(); + List GetFilteredList(UserSearchModel model); + UserViewModel? GetElement(UserSearchModel model); + UserViewModel? Insert(UserBindingModel model); + UserViewModel? Update(UserBindingModel model); + UserViewModel? Delete(UserBindingModel model); + } +} diff --git a/University/UniversityContracts/ViewModels/UserViewModel.cs b/University/UniversityContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..35afe78 --- /dev/null +++ b/University/UniversityContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,14 @@ +using UniversityDataModels.Models; +namespace UniversityContracts.ViewModels +{ + public class UserViewModel : IUserModel + { + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Surname { get; set; } = String.Empty; + public string PhoneNumber { get; set; } = String.Empty; + public string Position { get; set; } = String.Empty; + public string Login { get; set; } = String.Empty; + public string Password { get; set; } = String.Empty; + } +} diff --git a/University/UniversityDataModels/Models/IUserModel.cs b/University/UniversityDataModels/Models/IUserModel.cs new file mode 100644 index 0000000..a4a74d0 --- /dev/null +++ b/University/UniversityDataModels/Models/IUserModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UniversityDataModels.Models +{ + public interface IUserModel : IId + { + string Name { get; } + string Surname { get; } + string PhoneNumber { get; } + string Position { get; } + string Login { get; } + string Password { get; } + } +} From dadcc5b61a5cf2e9ac1aa83b8ef7ccaac5af79f9 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 22:27:21 +0400 Subject: [PATCH 04/13] add report --- .../BindingModels/ReportBindingModel.cs | 12 ++++++++++++ .../BuisnessLogicContracts/IReportLogic.cs | 10 ++++++++++ .../ViewModels/ReportStudentDisciplineViewModel.cs | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 University/UniversityContracts/BindingModels/ReportBindingModel.cs create mode 100644 University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs create mode 100644 University/UniversityContracts/ViewModels/ReportStudentDisciplineViewModel.cs diff --git a/University/UniversityContracts/BindingModels/ReportBindingModel.cs b/University/UniversityContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..f0ef3a5 --- /dev/null +++ b/University/UniversityContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,12 @@ +using UniversityContracts.ViewModels; + +namespace UniversityContracts.BindingModels +{ + public class ReportBindingModel + { + public string? FileName { get; set; } = string.Empty; + public DateTime? From { get; set; } + public DateTime? To { get; set; } + List Students { get; set; } = new(); + } +} diff --git a/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs b/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs new file mode 100644 index 0000000..c5e3818 --- /dev/null +++ b/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs @@ -0,0 +1,10 @@ +using UniversityContracts.BindingModels; +using UniversityContracts.ViewModels; + +namespace UniversityContracts.BuisnessLogicContracts +{ + public interface IReportLogic + { + List GetStudentDiscipline(ReportBindingModel model); + } +} diff --git a/University/UniversityContracts/ViewModels/ReportStudentDisciplineViewModel.cs b/University/UniversityContracts/ViewModels/ReportStudentDisciplineViewModel.cs new file mode 100644 index 0000000..9ce5ab1 --- /dev/null +++ b/University/UniversityContracts/ViewModels/ReportStudentDisciplineViewModel.cs @@ -0,0 +1,8 @@ +namespace UniversityContracts.ViewModels +{ + public class ReportStudentDisciplineViewModel + { + public string StudentName { get; set; } = string.Empty; + public List Disciplines { get; set; } = new(); + } +} From e3ec7c8acdb7527680ca470c063c006e6e1037d5 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 22:32:28 +0400 Subject: [PATCH 05/13] add public in report --- .../UniversityContracts/BindingModels/ReportBindingModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/University/UniversityContracts/BindingModels/ReportBindingModel.cs b/University/UniversityContracts/BindingModels/ReportBindingModel.cs index f0ef3a5..38b7fbe 100644 --- a/University/UniversityContracts/BindingModels/ReportBindingModel.cs +++ b/University/UniversityContracts/BindingModels/ReportBindingModel.cs @@ -7,6 +7,6 @@ namespace UniversityContracts.BindingModels public string? FileName { get; set; } = string.Empty; public DateTime? From { get; set; } public DateTime? To { get; set; } - List Students { get; set; } = new(); + public List Students { get; set; } = new(); } } From 59e6a1418f0d15a5cbedcda79c38347285c18df9 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 23:17:52 +0400 Subject: [PATCH 06/13] change dictionaries --- University/UniversityDataModels/Models/IDisciplineModel.cs | 1 + University/UniversityDataModels/Models/IStatementModel.cs | 1 - University/UniversityDataModels/Models/IStudentModel.cs | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/University/UniversityDataModels/Models/IDisciplineModel.cs b/University/UniversityDataModels/Models/IDisciplineModel.cs index a40373f..c2c26ae 100644 --- a/University/UniversityDataModels/Models/IDisciplineModel.cs +++ b/University/UniversityDataModels/Models/IDisciplineModel.cs @@ -4,5 +4,6 @@ { String Name { get; } String Department { get; } + int StatementId { get; } } } diff --git a/University/UniversityDataModels/Models/IStatementModel.cs b/University/UniversityDataModels/Models/IStatementModel.cs index 6188a75..681f016 100644 --- a/University/UniversityDataModels/Models/IStatementModel.cs +++ b/University/UniversityDataModels/Models/IStatementModel.cs @@ -4,6 +4,5 @@ { DateTime Date { get; } int HoursCount { get; } - Dictionary Students { get; } } } diff --git a/University/UniversityDataModels/Models/IStudentModel.cs b/University/UniversityDataModels/Models/IStudentModel.cs index ce5db79..1ff6eb5 100644 --- a/University/UniversityDataModels/Models/IStudentModel.cs +++ b/University/UniversityDataModels/Models/IStudentModel.cs @@ -5,5 +5,6 @@ String Name { get; } String RecordCardNumber { get; } Dictionary Results { get; } + Dictionary Statements { get; } } } From c863490d687a807244816a48dd489a3545b04c5c Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 23:20:25 +0400 Subject: [PATCH 07/13] change dictionaries in contracts --- .../UniversityContracts/BindingModels/DisciplineBindingModel.cs | 1 + .../UniversityContracts/BindingModels/StatementBindingModel.cs | 1 - .../UniversityContracts/BindingModels/StudentBindingModel.cs | 1 + University/UniversityContracts/ViewModels/DisciplineViewModel.cs | 1 + University/UniversityContracts/ViewModels/StatementViewModel.cs | 1 - University/UniversityContracts/ViewModels/StudentViewModel.cs | 1 + 6 files changed, 4 insertions(+), 2 deletions(-) diff --git a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs index 806a25f..9b07450 100644 --- a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs +++ b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; + public int StatementId { get; set; } } } diff --git a/University/UniversityContracts/BindingModels/StatementBindingModel.cs b/University/UniversityContracts/BindingModels/StatementBindingModel.cs index d584937..7cf9d4f 100644 --- a/University/UniversityContracts/BindingModels/StatementBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StatementBindingModel.cs @@ -7,6 +7,5 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); public int HoursCount { get; set; } - public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/BindingModels/StudentBindingModel.cs b/University/UniversityContracts/BindingModels/StudentBindingModel.cs index 26869e3..f3d682b 100644 --- a/University/UniversityContracts/BindingModels/StudentBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StudentBindingModel.cs @@ -8,5 +8,6 @@ namespace UniversityContracts.BindingModels public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; public Dictionary Results { get; set; } = new(); + public Dictionary Statements { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs index 472734a..4b16129 100644 --- a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs +++ b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs @@ -7,5 +7,6 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; + public int StatementId { get; set; } } } diff --git a/University/UniversityContracts/ViewModels/StatementViewModel.cs b/University/UniversityContracts/ViewModels/StatementViewModel.cs index b3ded91..728fb53 100644 --- a/University/UniversityContracts/ViewModels/StatementViewModel.cs +++ b/University/UniversityContracts/ViewModels/StatementViewModel.cs @@ -7,6 +7,5 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); public int HoursCount { get; set; } - public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/StudentViewModel.cs b/University/UniversityContracts/ViewModels/StudentViewModel.cs index 141b33e..3c44bff 100644 --- a/University/UniversityContracts/ViewModels/StudentViewModel.cs +++ b/University/UniversityContracts/ViewModels/StudentViewModel.cs @@ -8,5 +8,6 @@ namespace UniversityContracts.ViewModels public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; public Dictionary Results { get; set; } = new(); + public Dictionary Statements { get; set; } = new(); } } From 231839d439cda41b74735e5420660bdc3c066db9 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 00:09:22 +0400 Subject: [PATCH 08/13] refactoring models and cotracts --- .../BindingModels/ExaminationResultBindingModel.cs | 1 + .../UniversityContracts/BindingModels/StudentBindingModel.cs | 1 - .../SearchModels/ExaminationResultSearchModel.cs | 2 ++ .../UniversityContracts/SearchModels/StatementSearchModel.cs | 2 ++ .../ViewModels/ExaminationResultViewModel.cs | 1 + University/UniversityContracts/ViewModels/StudentViewModel.cs | 1 - .../UniversityDataModels/Models/IExaminationResultModel.cs | 1 + University/UniversityDataModels/Models/IStudentModel.cs | 1 - 8 files changed, 7 insertions(+), 3 deletions(-) diff --git a/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs b/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs index 8fbd495..372056d 100644 --- a/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs +++ b/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs @@ -9,5 +9,6 @@ namespace UniversityContracts.BindingModels public string ExaminationForm { get; set; } = String.Empty; public MarkType Mark { get; set; } = MarkType.Неизвестен; public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/BindingModels/StudentBindingModel.cs b/University/UniversityContracts/BindingModels/StudentBindingModel.cs index f3d682b..884775e 100644 --- a/University/UniversityContracts/BindingModels/StudentBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StudentBindingModel.cs @@ -7,7 +7,6 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; - public Dictionary Results { get; set; } = new(); public Dictionary Statements { get; set; } = new(); } } diff --git a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs index 4f27f9f..822f3ec 100644 --- a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs +++ b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs @@ -6,5 +6,7 @@ namespace UniversityContracts.SearchModels public class ExaminationResultSearchModel { public int? Id { get; set; } + DateTime? From { get; set; } + DateTime? To { get; set; } } } diff --git a/University/UniversityContracts/SearchModels/StatementSearchModel.cs b/University/UniversityContracts/SearchModels/StatementSearchModel.cs index 7c3ca9d..7b2a0b1 100644 --- a/University/UniversityContracts/SearchModels/StatementSearchModel.cs +++ b/University/UniversityContracts/SearchModels/StatementSearchModel.cs @@ -5,5 +5,7 @@ namespace UniversityContracts.SearchModels public class StatementSearchModel { public int? Id { get; set; } + DateTime? From { get; set; } + DateTime? To { get; set; } } } diff --git a/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs b/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs index 379ac90..98817e6 100644 --- a/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs +++ b/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs @@ -9,5 +9,6 @@ namespace UniversityContracts.ViewModels public string ExaminationForm { get; set; } = String.Empty; public MarkType Mark { get; set; } = MarkType.Неизвестен; public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public Dictionary Students { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/StudentViewModel.cs b/University/UniversityContracts/ViewModels/StudentViewModel.cs index 3c44bff..4cfc34d 100644 --- a/University/UniversityContracts/ViewModels/StudentViewModel.cs +++ b/University/UniversityContracts/ViewModels/StudentViewModel.cs @@ -7,7 +7,6 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string RecordCardNumber { get; set; } = String.Empty; - public Dictionary Results { get; set; } = new(); public Dictionary Statements { get; set; } = new(); } } diff --git a/University/UniversityDataModels/Models/IExaminationResultModel.cs b/University/UniversityDataModels/Models/IExaminationResultModel.cs index c3c33e1..6180c87 100644 --- a/University/UniversityDataModels/Models/IExaminationResultModel.cs +++ b/University/UniversityDataModels/Models/IExaminationResultModel.cs @@ -6,5 +6,6 @@ namespace UniversityDataModels.Models String ExaminationForm { get; } MarkType Mark { get; } DateTime Date { get; } + Dictionary Students { get; } } } diff --git a/University/UniversityDataModels/Models/IStudentModel.cs b/University/UniversityDataModels/Models/IStudentModel.cs index 1ff6eb5..d296aaa 100644 --- a/University/UniversityDataModels/Models/IStudentModel.cs +++ b/University/UniversityDataModels/Models/IStudentModel.cs @@ -4,7 +4,6 @@ { String Name { get; } String RecordCardNumber { get; } - Dictionary Results { get; } Dictionary Statements { get; } } } From 3a8864eed5b27035b33aecceee0286ae21ce0d78 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 00:16:57 +0400 Subject: [PATCH 09/13] add public modifiers --- .../SearchModels/ExaminationResultSearchModel.cs | 4 ++-- .../UniversityContracts/SearchModels/StatementSearchModel.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs index 822f3ec..53c1f00 100644 --- a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs +++ b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs @@ -6,7 +6,7 @@ namespace UniversityContracts.SearchModels public class ExaminationResultSearchModel { public int? Id { get; set; } - DateTime? From { get; set; } - DateTime? To { get; set; } + public DateTime? From { get; set; } + public DateTime? To { get; set; } } } diff --git a/University/UniversityContracts/SearchModels/StatementSearchModel.cs b/University/UniversityContracts/SearchModels/StatementSearchModel.cs index 7b2a0b1..6e807ad 100644 --- a/University/UniversityContracts/SearchModels/StatementSearchModel.cs +++ b/University/UniversityContracts/SearchModels/StatementSearchModel.cs @@ -5,7 +5,7 @@ namespace UniversityContracts.SearchModels public class StatementSearchModel { public int? Id { get; set; } - DateTime? From { get; set; } - DateTime? To { get; set; } + public DateTime? From { get; set; } + public DateTime? To { get; set; } } } From 53703e0fd6d74dcebee7a8f315bd29480562e7e4 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 00:26:13 +0400 Subject: [PATCH 10/13] finalized report --- .../BuisnessLogicContracts/IReportLogic.cs | 7 ++++++- .../ViewModels/ReportStudentsViewModel.cs | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs diff --git a/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs b/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs index c5e3818..1a418ed 100644 --- a/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs +++ b/University/UniversityContracts/BuisnessLogicContracts/IReportLogic.cs @@ -1,4 +1,5 @@ -using UniversityContracts.BindingModels; + +using UniversityContracts.BindingModels; using UniversityContracts.ViewModels; namespace UniversityContracts.BuisnessLogicContracts @@ -6,5 +7,9 @@ namespace UniversityContracts.BuisnessLogicContracts public interface IReportLogic { List GetStudentDiscipline(ReportBindingModel model); + List GetStudens(ReportBindingModel model); + void SaveStudentsToWord(); + void SaveStudentsToExcel(); + void SaveStudentsToPdf(); } } diff --git a/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs b/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs new file mode 100644 index 0000000..385cf79 --- /dev/null +++ b/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs @@ -0,0 +1,14 @@ +using UniversityDataModels.Enums; + +namespace UniversityContracts.ViewModels +{ + public class ReportStudentsViewModel + { + string StudentName { get; set; } = string.Empty; + string ExaminationForm { get; set; } = string.Empty; + MarkType mark { get; set; } = MarkType.Неизвестен; + DateTime ExaminationResultDate { get; set; } + int HoursCount { get; set; } + DateTime StatementDate { get; set; } + } +} From 47ca9689243ffbed87e7b0a1b2e74704da0628ce Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 00:35:50 +0400 Subject: [PATCH 11/13] add public in students report view model --- .../ViewModels/ReportStudentsViewModel.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs b/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs index 385cf79..fa3ff50 100644 --- a/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs +++ b/University/UniversityContracts/ViewModels/ReportStudentsViewModel.cs @@ -4,11 +4,11 @@ namespace UniversityContracts.ViewModels { public class ReportStudentsViewModel { - string StudentName { get; set; } = string.Empty; - string ExaminationForm { get; set; } = string.Empty; - MarkType mark { get; set; } = MarkType.Неизвестен; - DateTime ExaminationResultDate { get; set; } - int HoursCount { get; set; } - DateTime StatementDate { get; set; } + public string StudentName { get; set; } = string.Empty; + public string ExaminationForm { get; set; } = string.Empty; + public MarkType mark { get; set; } = MarkType.Неизвестен; + public DateTime ExaminationResultDate { get; set; } + public int HoursCount { get; set; } + public DateTime StatementDate { get; set; } } } From a174a10be3c86cac289ff2550724d64831fda19e Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 01:06:58 +0400 Subject: [PATCH 12/13] add statemebts in discipline --- .../UniversityContracts/BindingModels/DisciplineBindingModel.cs | 1 + .../UniversityContracts/ViewModels/DisciplineViewModel.cs | 1 + University/UniversityDataModels/Models/IDisciplineModel.cs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs index 9b07450..627295e 100644 --- a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs +++ b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs @@ -8,5 +8,6 @@ namespace UniversityContracts.BindingModels public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; public int StatementId { get; set; } + public Dictionary DisciplineStatements { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs index 4b16129..a5f888d 100644 --- a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs +++ b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs @@ -8,5 +8,6 @@ namespace UniversityContracts.ViewModels public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; public int StatementId { get; set; } + public Dictionary DisciplineStatements { get; set; } = new(); } } diff --git a/University/UniversityDataModels/Models/IDisciplineModel.cs b/University/UniversityDataModels/Models/IDisciplineModel.cs index c2c26ae..efd1c9d 100644 --- a/University/UniversityDataModels/Models/IDisciplineModel.cs +++ b/University/UniversityDataModels/Models/IDisciplineModel.cs @@ -4,6 +4,6 @@ { String Name { get; } String Department { get; } - int StatementId { get; } + Dictionary DisciplineStatements { get; } } } From bfa38abc7b14d626315275c451139bcd812c41a7 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 9 Apr 2023 01:14:44 +0400 Subject: [PATCH 13/13] delete statementId from discipline --- .../UniversityContracts/BindingModels/DisciplineBindingModel.cs | 1 - University/UniversityContracts/ViewModels/DisciplineViewModel.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs index 627295e..8865ef1 100644 --- a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs +++ b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs @@ -7,7 +7,6 @@ namespace UniversityContracts.BindingModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; - public int StatementId { get; set; } public Dictionary DisciplineStatements { get; set; } = new(); } } diff --git a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs index a5f888d..aaa8cde 100644 --- a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs +++ b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs @@ -7,7 +7,6 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public string Name { get; set; } = String.Empty; public string Department { get; set; } = String.Empty; - public int StatementId { get; set; } public Dictionary DisciplineStatements { get; set; } = new(); } }