From 1e7d4a375460c845693fb8d1e1c59ada2157afa6 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 2 Apr 2023 17:41:41 +0400 Subject: [PATCH 1/2] refactoring --- .../BindingModels/ActivityBindingModel.cs | 6 +++--- .../BindingModels/DisciplineBindingModel.cs | 6 +++--- .../BindingModels/ExaminationResultBindingModel.cs | 8 ++++---- .../BindingModels/ReportTypeBindingModel.cs | 4 ++-- .../BindingModels/StatementBindingModel.cs | 6 +++--- .../BindingModels/StudentBindingModel.cs | 6 +++--- .../SearchModels/ActivitySearchModel.cs | 6 +++--- .../SearchModels/DisciplineSearchModel.cs | 6 +++--- .../SearchModels/ExaminationResultSearchModel.cs | 8 ++++---- .../SearchModels/ReportTypeSearchModel.cs | 4 ++-- .../SearchModels/StatementSearchModel.cs | 6 +++--- .../SearchModels/StudentSearchModel.cs | 6 +++--- .../UniversityContracts/ViewModels/ActivityViewModel.cs | 6 +++--- .../UniversityContracts/ViewModels/DisciplineViewModel.cs | 6 +++--- .../ViewModels/ExaminationResultSearchModel.cs | 8 ++++---- .../UniversityContracts/ViewModels/ReportTypeViewModel.cs | 4 ++-- .../UniversityContracts/ViewModels/StatementViewModel.cs | 6 +++--- .../UniversityContracts/ViewModels/StudentViewModel.cs | 6 +++--- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/University/UniversityContracts/BindingModels/ActivityBindingModel.cs b/University/UniversityContracts/BindingModels/ActivityBindingModel.cs index 2c03e22..e868226 100644 --- a/University/UniversityContracts/BindingModels/ActivityBindingModel.cs +++ b/University/UniversityContracts/BindingModels/ActivityBindingModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.BindingModels { public class ActivityBindingModel : IActivityModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int Number { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Number { get; set; } } } diff --git a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs index 8e4db01..806a25f 100644 --- a/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs +++ b/University/UniversityContracts/BindingModels/DisciplineBindingModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.BindingModels { public class DisciplineBindingModel : IDisciplineModel { - public int Id { get; } - public string Name { get; } = String.Empty; - public string Department { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Department { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs b/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs index d4ec633..8fbd495 100644 --- a/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs +++ b/University/UniversityContracts/BindingModels/ExaminationResultBindingModel.cs @@ -5,9 +5,9 @@ namespace UniversityContracts.BindingModels { public class ExaminationResultBindingModel : IExaminationResultModel { - public int Id { get; } - public string ExaminationForm { get; } = String.Empty; - public MarkType Mark { get; } = MarkType.Неизвестен; - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Id { get; set; } + public string ExaminationForm { get; set; } = String.Empty; + public MarkType Mark { get; set; } = MarkType.Неизвестен; + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); } } diff --git a/University/UniversityContracts/BindingModels/ReportTypeBindingModel.cs b/University/UniversityContracts/BindingModels/ReportTypeBindingModel.cs index 92a2f30..063692a 100644 --- a/University/UniversityContracts/BindingModels/ReportTypeBindingModel.cs +++ b/University/UniversityContracts/BindingModels/ReportTypeBindingModel.cs @@ -4,7 +4,7 @@ namespace UniversityContracts.BindingModels { public class ReportTypeBindingModel : IReportTypeModel { - public int Id { get; } - public string Name { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/BindingModels/StatementBindingModel.cs b/University/UniversityContracts/BindingModels/StatementBindingModel.cs index 7e9201e..7cf9d4f 100644 --- a/University/UniversityContracts/BindingModels/StatementBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StatementBindingModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.BindingModels { public class StatementBindingModel : IStatementModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int HoursCount { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int HoursCount { get; set; } } } diff --git a/University/UniversityContracts/BindingModels/StudentBindingModel.cs b/University/UniversityContracts/BindingModels/StudentBindingModel.cs index eb0c952..03cf631 100644 --- a/University/UniversityContracts/BindingModels/StudentBindingModel.cs +++ b/University/UniversityContracts/BindingModels/StudentBindingModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.BindingModels { public class StudentBindingModel : IStudentModel { - public int Id { get; } - public string Name { get; } = String.Empty; - public string RecordCardNumber { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string RecordCardNumber { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/SearchModels/ActivitySearchModel.cs b/University/UniversityContracts/SearchModels/ActivitySearchModel.cs index c6c9007..a1b5768 100644 --- a/University/UniversityContracts/SearchModels/ActivitySearchModel.cs +++ b/University/UniversityContracts/SearchModels/ActivitySearchModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.SearchModels { public class ActivitySearchModel : IActivityModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int Number { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Number { get; set; } } } diff --git a/University/UniversityContracts/SearchModels/DisciplineSearchModel.cs b/University/UniversityContracts/SearchModels/DisciplineSearchModel.cs index bbf0086..7ae530e 100644 --- a/University/UniversityContracts/SearchModels/DisciplineSearchModel.cs +++ b/University/UniversityContracts/SearchModels/DisciplineSearchModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.SearchModels { public class DisciplineSearchModel : IDisciplineModel { - public int Id { get; } - public string Name { get; } = String.Empty; - public string Department { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Department { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs index 9165a74..b2c979b 100644 --- a/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs +++ b/University/UniversityContracts/SearchModels/ExaminationResultSearchModel.cs @@ -5,9 +5,9 @@ namespace UniversityContracts.SearchModels { public class ExaminationResultSearchModel : IExaminationResultModel { - public int Id { get; } - public string ExaminationForm { get; } = String.Empty; - public MarkType Mark { get; } = MarkType.Неизвестен; - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Id { get; set; } + public string ExaminationForm { get; set; } = String.Empty; + public MarkType Mark { get; set; } = MarkType.Неизвестен; + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); } } diff --git a/University/UniversityContracts/SearchModels/ReportTypeSearchModel.cs b/University/UniversityContracts/SearchModels/ReportTypeSearchModel.cs index 14db649..72c645c 100644 --- a/University/UniversityContracts/SearchModels/ReportTypeSearchModel.cs +++ b/University/UniversityContracts/SearchModels/ReportTypeSearchModel.cs @@ -4,7 +4,7 @@ namespace UniversityContracts.SearchModels { public class ReportTypeSearchModel : IReportTypeModel { - public int Id { get; } - public string Name { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/SearchModels/StatementSearchModel.cs b/University/UniversityContracts/SearchModels/StatementSearchModel.cs index e68da13..dc3c24c 100644 --- a/University/UniversityContracts/SearchModels/StatementSearchModel.cs +++ b/University/UniversityContracts/SearchModels/StatementSearchModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.SearchModels { public class StatementSearchModel : IStatementModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int HoursCount { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int HoursCount { get; set; } } } diff --git a/University/UniversityContracts/SearchModels/StudentSearchModel.cs b/University/UniversityContracts/SearchModels/StudentSearchModel.cs index 9ad18ba..820ddf1 100644 --- a/University/UniversityContracts/SearchModels/StudentSearchModel.cs +++ b/University/UniversityContracts/SearchModels/StudentSearchModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.SearchModels { public class StudentSearchModel : IStudentModel { - public int Id { get; } - public string Name { get; } = String.Empty; - public string RecordCardNumber { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string RecordCardNumber { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/ViewModels/ActivityViewModel.cs b/University/UniversityContracts/ViewModels/ActivityViewModel.cs index 83e412f..a3cb121 100644 --- a/University/UniversityContracts/ViewModels/ActivityViewModel.cs +++ b/University/UniversityContracts/ViewModels/ActivityViewModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.ViewModels { public class ActivityViewModel : IActivityModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int Number { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Number { get; set; } } } diff --git a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs index e388e15..472734a 100644 --- a/University/UniversityContracts/ViewModels/DisciplineViewModel.cs +++ b/University/UniversityContracts/ViewModels/DisciplineViewModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.ViewModels { public class DisciplineViewModel : IDisciplineModel { - public int Id { get; } - public string Name { get; } = String.Empty; - public string Department { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; + public string Department { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs b/University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs index 3761885..498ecaf 100644 --- a/University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs +++ b/University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs @@ -5,9 +5,9 @@ namespace UniversityContracts.ViewModels { public class ExaminationResultSearchModel : IExaminationResultModel { - public int Id { get; } - public string ExaminationForm { get; } = String.Empty; - public MarkType Mark { get; } = MarkType.Неизвестен; - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int Id { get; set; } + public string ExaminationForm { get; set; } = String.Empty; + public MarkType Mark { get; set; } = MarkType.Неизвестен; + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); } } diff --git a/University/UniversityContracts/ViewModels/ReportTypeViewModel.cs b/University/UniversityContracts/ViewModels/ReportTypeViewModel.cs index c52abb0..d3dfcbf 100644 --- a/University/UniversityContracts/ViewModels/ReportTypeViewModel.cs +++ b/University/UniversityContracts/ViewModels/ReportTypeViewModel.cs @@ -4,7 +4,7 @@ namespace UniversityContracts.ViewModels { public class ReportTypeViewModel : IReportTypeModel { - public int Id { get; } - public string Name { get; } = String.Empty; + public int Id { get; set; } + public string Name { get; set; } = String.Empty; } } diff --git a/University/UniversityContracts/ViewModels/StatementViewModel.cs b/University/UniversityContracts/ViewModels/StatementViewModel.cs index 6df7c95..728fb53 100644 --- a/University/UniversityContracts/ViewModels/StatementViewModel.cs +++ b/University/UniversityContracts/ViewModels/StatementViewModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.ViewModels { public class StatementViewModel : IStatementModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int HoursCount { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int HoursCount { get; set; } } } diff --git a/University/UniversityContracts/ViewModels/StudentViewModel.cs b/University/UniversityContracts/ViewModels/StudentViewModel.cs index d59d84c..3e119aa 100644 --- a/University/UniversityContracts/ViewModels/StudentViewModel.cs +++ b/University/UniversityContracts/ViewModels/StudentViewModel.cs @@ -4,8 +4,8 @@ namespace UniversityContracts.ViewModels { public class StudentViewModel : IStatementModel { - public int Id { get; } - public DateTime Date { get; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); - public int HoursCount { get; } + public int Id { get; set; } + public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc); + public int HoursCount { get; set; } } } From 27b7fee2d8ebd6395b1088409574d92f05f442c8 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:12:33 +0400 Subject: [PATCH 2/2] changed storage interfaces --- .../StoragesContracts/IActivityStorage.cs | 10 +++++++++- .../StoragesContracts/IDisciplineStorage.cs | 10 +++++++++- .../StoragesContracts/IExaminationResultStorage.cs | 10 +++++++++- .../StoragesContracts/IReportTypeStorage.cs | 10 +++++++++- .../StoragesContracts/IStatementStorage.cs | 10 +++++++++- .../StoragesContracts/IStudentStorage.cs | 10 +++++++++- ...ultSearchModel.cs => ExaminationResultViewModel.cs} | 2 +- 7 files changed, 55 insertions(+), 7 deletions(-) rename University/UniversityContracts/ViewModels/{ExaminationResultSearchModel.cs => ExaminationResultViewModel.cs} (85%) diff --git a/University/UniversityContracts/StoragesContracts/IActivityStorage.cs b/University/UniversityContracts/StoragesContracts/IActivityStorage.cs index 28c2329..518fe7e 100644 --- a/University/UniversityContracts/StoragesContracts/IActivityStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IActivityStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { public interface IActivityStorage { + List GetFullList(); + List GetFilteredList(ActivitySearchModel model); + ActivityViewModel? GetElement(ActivitySearchModel model); + ActivityViewModel? Insert(ActivityBindingModel model); + ActivityViewModel? Update(ActivityBindingModel model); + ActivityViewModel? Delete(ActivityBindingModel model); } } diff --git a/University/UniversityContracts/StoragesContracts/IDisciplineStorage.cs b/University/UniversityContracts/StoragesContracts/IDisciplineStorage.cs index 0c3e1d9..30c246b 100644 --- a/University/UniversityContracts/StoragesContracts/IDisciplineStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IDisciplineStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { public interface IDisciplineStorage { + List GetFullList(); + List GetFilteredList(DisciplineSearchModel model); + DisciplineViewModel? GetElement(DisciplineSearchModel model); + DisciplineViewModel? Insert(DisciplineBindingModel model); + DisciplineViewModel? Update(DisciplineBindingModel model); + DisciplineViewModel? Delete(DisciplineBindingModel model); } } diff --git a/University/UniversityContracts/StoragesContracts/IExaminationResultStorage.cs b/University/UniversityContracts/StoragesContracts/IExaminationResultStorage.cs index 1090c8c..b96b72a 100644 --- a/University/UniversityContracts/StoragesContracts/IExaminationResultStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IExaminationResultStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { public interface IExaminationResultStorage { + List GetFullList(); + List GetFilteredList(ExaminationResultSearchModel model); + ExaminationResultViewModel? GetElement(ExaminationResultSearchModel model); + ExaminationResultViewModel? Insert(ExaminationResultBindingModel model); + ExaminationResultViewModel? Update(ExaminationResultBindingModel model); + ExaminationResultViewModel? Delete(ExaminationResultBindingModel model); } } diff --git a/University/UniversityContracts/StoragesContracts/IReportTypeStorage.cs b/University/UniversityContracts/StoragesContracts/IReportTypeStorage.cs index cb624e8..aae192f 100644 --- a/University/UniversityContracts/StoragesContracts/IReportTypeStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IReportTypeStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { public interface IReportTypeStorage { + List GetFullList(); + List GetFilteredList(ReportTypeSearchModel model); + ReportTypeViewModel? GetElement(ReportTypeSearchModel model); + ReportTypeViewModel? Insert(ReportTypeBindingModel model); + ReportTypeViewModel? Update(ReportTypeBindingModel model); + ReportTypeViewModel? Delete(ReportTypeBindingModel model); } } diff --git a/University/UniversityContracts/StoragesContracts/IStatementStorage.cs b/University/UniversityContracts/StoragesContracts/IStatementStorage.cs index e3dc4fd..052af30 100644 --- a/University/UniversityContracts/StoragesContracts/IStatementStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IStatementStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { public interface IStatementStorage { + List GetFullList(); + List GetFilteredList(StatementSearchModel model); + StatementViewModel? GetElement(StatementSearchModel model); + StatementViewModel? Insert(StatementBindingModel model); + StatementViewModel? Update(StatementBindingModel model); + StatementViewModel? Delete(StatementBindingModel model); } } diff --git a/University/UniversityContracts/StoragesContracts/IStudentStorage.cs b/University/UniversityContracts/StoragesContracts/IStudentStorage.cs index 0fc67db..ea3bd7e 100644 --- a/University/UniversityContracts/StoragesContracts/IStudentStorage.cs +++ b/University/UniversityContracts/StoragesContracts/IStudentStorage.cs @@ -1,8 +1,16 @@ -using UniversityDataModels.Models; +using UniversityContracts.BindingModels; +using UniversityContracts.SearchModels; +using UniversityContracts.ViewModels; namespace UniversityContracts.StoragesContracts { 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/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs b/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs similarity index 85% rename from University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs rename to University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs index 498ecaf..379ac90 100644 --- a/University/UniversityContracts/ViewModels/ExaminationResultSearchModel.cs +++ b/University/UniversityContracts/ViewModels/ExaminationResultViewModel.cs @@ -3,7 +3,7 @@ using UniversityDataModels.Models; namespace UniversityContracts.ViewModels { - public class ExaminationResultSearchModel : IExaminationResultModel + public class ExaminationResultViewModel : IExaminationResultModel { public int Id { get; set; } public string ExaminationForm { get; set; } = String.Empty;