From 0434c5f14cd22a053585ea06593bb7fae82a9a08 Mon Sep 17 00:00:00 2001 From: Kirill <117719052+KirillFirsof@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:11:58 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D0=B7=D0=B0=D0=BA=D0=BE=D0=BD=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/AchievementBindingModel.cs | 2 +- .../IAchievementLogic.cs | 20 ++++++++++++++++++ .../BusinessLogicsContracts/IInterestLogic.cs | 20 ++++++++++++++++++ .../BusinessLogicsContracts/ILessonLogic.cs | 20 ++++++++++++++++++ .../BusinessLogicsContracts/IUserLogic.cs | 20 ++++++++++++++++++ School/SchoolContracts/SchoolContracts.csproj | 5 ----- .../StoragesContracts/IAchievementStorage.cs | 21 +++++++++++++++++++ .../StoragesContracts/IInterestStorage.cs | 21 +++++++++++++++++++ .../StoragesContracts/ILessonStorage.cs | 21 +++++++++++++++++++ .../StoragesContracts/IUserStorage.cs | 21 +++++++++++++++++++ .../ViewModels/AchievementViewModel.cs | 2 +- .../ViewModels/LessonViewModel.cs | 2 +- .../ViewModels/UserViewModel.cs | 2 +- 13 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 School/SchoolContracts/BusinessLogicsContracts/IAchievementLogic.cs create mode 100644 School/SchoolContracts/BusinessLogicsContracts/IInterestLogic.cs create mode 100644 School/SchoolContracts/BusinessLogicsContracts/ILessonLogic.cs create mode 100644 School/SchoolContracts/BusinessLogicsContracts/IUserLogic.cs create mode 100644 School/SchoolContracts/StoragesContracts/IAchievementStorage.cs create mode 100644 School/SchoolContracts/StoragesContracts/IInterestStorage.cs create mode 100644 School/SchoolContracts/StoragesContracts/ILessonStorage.cs create mode 100644 School/SchoolContracts/StoragesContracts/IUserStorage.cs diff --git a/School/SchoolContracts/BindingModels/AchievementBindingModel.cs b/School/SchoolContracts/BindingModels/AchievementBindingModel.cs index 2bd774e..b293ecd 100644 --- a/School/SchoolContracts/BindingModels/AchievementBindingModel.cs +++ b/School/SchoolContracts/BindingModels/AchievementBindingModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace SchoolContracts.BindingModels { - internal class AchievementBindingModel : IAchievementModel + public class AchievementBindingModel : IAchievementModel { public int Id { get; set; } public int LessonId { get; set; } diff --git a/School/SchoolContracts/BusinessLogicsContracts/IAchievementLogic.cs b/School/SchoolContracts/BusinessLogicsContracts/IAchievementLogic.cs new file mode 100644 index 0000000..60b80ce --- /dev/null +++ b/School/SchoolContracts/BusinessLogicsContracts/IAchievementLogic.cs @@ -0,0 +1,20 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.BusinessLogicsContracts +{ + public interface IAchievementLogic + { + List? ReadList(AchievementSearchModel? model); + AchievementViewModel? ReadElement(AchievementSearchModel model); + bool Create(AchievementBindingModel model); + bool Update(AchievementBindingModel model); + bool Delete(AchievementBindingModel model); + } +} diff --git a/School/SchoolContracts/BusinessLogicsContracts/IInterestLogic.cs b/School/SchoolContracts/BusinessLogicsContracts/IInterestLogic.cs new file mode 100644 index 0000000..1d8518e --- /dev/null +++ b/School/SchoolContracts/BusinessLogicsContracts/IInterestLogic.cs @@ -0,0 +1,20 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.BusinessLogicsContracts +{ + public interface IInterestLogic + { + List? ReadList(InterestSearchModel? model); + InterestViewModel? ReadElement(InterestSearchModel model); + bool Create(InterestBindingModel model); + bool Update(InterestBindingModel model); + bool Delete(InterestBindingModel model); + } +} diff --git a/School/SchoolContracts/BusinessLogicsContracts/ILessonLogic.cs b/School/SchoolContracts/BusinessLogicsContracts/ILessonLogic.cs new file mode 100644 index 0000000..5a94de4 --- /dev/null +++ b/School/SchoolContracts/BusinessLogicsContracts/ILessonLogic.cs @@ -0,0 +1,20 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.BusinessLogicsContracts +{ + public interface ILessonLogic + { + List? ReadList(LessonSearchModel? model); + LessonViewModel? ReadElement(LessonSearchModel model); + bool Create(LessonBindingModel model); + bool Update(LessonBindingModel model); + bool Delete(LessonBindingModel model); + } +} diff --git a/School/SchoolContracts/BusinessLogicsContracts/IUserLogic.cs b/School/SchoolContracts/BusinessLogicsContracts/IUserLogic.cs new file mode 100644 index 0000000..02a060a --- /dev/null +++ b/School/SchoolContracts/BusinessLogicsContracts/IUserLogic.cs @@ -0,0 +1,20 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.BusinessLogicsContracts +{ + 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/School/SchoolContracts/SchoolContracts.csproj b/School/SchoolContracts/SchoolContracts.csproj index c457f2f..6b94741 100644 --- a/School/SchoolContracts/SchoolContracts.csproj +++ b/School/SchoolContracts/SchoolContracts.csproj @@ -10,9 +10,4 @@ - - - - - diff --git a/School/SchoolContracts/StoragesContracts/IAchievementStorage.cs b/School/SchoolContracts/StoragesContracts/IAchievementStorage.cs new file mode 100644 index 0000000..fd84388 --- /dev/null +++ b/School/SchoolContracts/StoragesContracts/IAchievementStorage.cs @@ -0,0 +1,21 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.StoragesContracts +{ + public interface IAchievementStorage + { + List GetFullList(); + List GetFilteredList(AchievementSearchModel model); + AchievementViewModel? GetElement(AchievementSearchModel model); + AchievementViewModel? Insert(AchievementBindingModel model); + AchievementViewModel? Update(AchievementBindingModel model); + AchievementViewModel? Delete(AchievementBindingModel model); + } +} diff --git a/School/SchoolContracts/StoragesContracts/IInterestStorage.cs b/School/SchoolContracts/StoragesContracts/IInterestStorage.cs new file mode 100644 index 0000000..d0ec8a2 --- /dev/null +++ b/School/SchoolContracts/StoragesContracts/IInterestStorage.cs @@ -0,0 +1,21 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.StoragesContracts +{ + public interface IInterestStorage + { + List GetFullList(); + List GetFilteredList(InterestSearchModel model); + InterestViewModel? GetElement(InterestSearchModel model); + InterestViewModel? Insert(InterestBindingModel model); + InterestViewModel? Update(InterestBindingModel model); + InterestViewModel? Delete(InterestBindingModel model); + } +} diff --git a/School/SchoolContracts/StoragesContracts/ILessonStorage.cs b/School/SchoolContracts/StoragesContracts/ILessonStorage.cs new file mode 100644 index 0000000..f7870b3 --- /dev/null +++ b/School/SchoolContracts/StoragesContracts/ILessonStorage.cs @@ -0,0 +1,21 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.StoragesContracts +{ + public interface ILessonStorage + { + List GetFullList(); + List GetFilteredList(LessonSearchModel model); + LessonViewModel? GetElement(LessonSearchModel model); + LessonViewModel? Insert(LessonBindingModel model); + LessonViewModel? Update(LessonBindingModel model); + LessonViewModel? Delete(LessonBindingModel model); + } +} diff --git a/School/SchoolContracts/StoragesContracts/IUserStorage.cs b/School/SchoolContracts/StoragesContracts/IUserStorage.cs new file mode 100644 index 0000000..6db918d --- /dev/null +++ b/School/SchoolContracts/StoragesContracts/IUserStorage.cs @@ -0,0 +1,21 @@ +using SchoolContracts.BindingModels; +using SchoolContracts.SearchModels; +using SchoolContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolContracts.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/School/SchoolContracts/ViewModels/AchievementViewModel.cs b/School/SchoolContracts/ViewModels/AchievementViewModel.cs index ad56f1b..f9e10f9 100644 --- a/School/SchoolContracts/ViewModels/AchievementViewModel.cs +++ b/School/SchoolContracts/ViewModels/AchievementViewModel.cs @@ -8,7 +8,7 @@ using System.ComponentModel; namespace SchoolContracts.ViewModels { - internal class AchievementViewModel : IAchievementModel + public class AchievementViewModel : IAchievementModel { public int Id { get; set; } public int LessonId { get; set; } diff --git a/School/SchoolContracts/ViewModels/LessonViewModel.cs b/School/SchoolContracts/ViewModels/LessonViewModel.cs index e1d6a27..5ec7104 100644 --- a/School/SchoolContracts/ViewModels/LessonViewModel.cs +++ b/School/SchoolContracts/ViewModels/LessonViewModel.cs @@ -8,7 +8,7 @@ using System.ComponentModel; namespace SchoolContracts.ViewModels { - internal class LessonViewModel : ILessonModel + public class LessonViewModel : ILessonModel { public int Id { get; set; } public int UserId { get; set; } diff --git a/School/SchoolContracts/ViewModels/UserViewModel.cs b/School/SchoolContracts/ViewModels/UserViewModel.cs index e43b0e7..37eb421 100644 --- a/School/SchoolContracts/ViewModels/UserViewModel.cs +++ b/School/SchoolContracts/ViewModels/UserViewModel.cs @@ -8,7 +8,7 @@ using System.ComponentModel; namespace SchoolContracts.ViewModels { - internal class UserViewModel : IUserModel + public class UserViewModel : IUserModel { public int Id { get; set; } [DisplayName("Имя пользователя")]