From 3594acfa15c2240432a8d1fb50d14b8db3554ad9 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Mon, 3 Apr 2023 20:01:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=80=D1=83=D1=87=D0=B8=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C:=20=D1=81=D0=BB=D0=BE=D0=B9=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 --- SchoolAgainStudy/SchoolAgainStudy.sln | 6 +++ .../BindingModel/LessonBindingModel.cs | 25 ++++++++++++ .../BindingModel/MaterialBindingModel.cs | 18 +++++++++ .../BindingModel/ReportBindingModel.cs | 17 ++++++++ .../BindingModel/TaskBindingModel.cs | 24 ++++++++++++ .../BindingModel/TeacherBindingModel.cs | 26 +++++++++++++ .../BusinessLogicContracts/ILessonLogic.cs | 20 ++++++++++ .../BusinessLogicContracts/IMaterialLogic.cs | 20 ++++++++++ .../BusinessLogicContracts/IReportLogic.cs | 39 +++++++++++++++++++ .../BusinessLogicContracts/ITaskLogic.cs | 20 ++++++++++ .../BusinessLogicContracts/ITeacherLogic.cs | 20 ++++++++++ .../SchoolAgainStudyContracts.csproj | 9 +++++ .../SearchModel/LessonSearchModel.cs | 17 ++++++++ .../SearchModel/MaterialSearchModel.cs | 14 +++++++ .../SearchModel/TaskSearchModel.cs | 18 +++++++++ .../SearchModel/TeacherSearchModel.cs | 16 ++++++++ .../StorageContracts/ILessonStorage.cs | 21 ++++++++++ .../StorageContracts/IMaterialStorage.cs | 21 ++++++++++ .../StorageContracts/ITaskStorage.cs | 21 ++++++++++ .../StorageContracts/ITeacherStorage.cs | 21 ++++++++++ .../ViewModel/LessonViewModel.cs | 28 +++++++++++++ .../ViewModel/MaterialViewModel.cs | 20 ++++++++++ .../ViewModel/ReportDiyMaterialViewModel.cs | 14 +++++++ .../ViewModel/ReportLessonTaskViewModel.cs | 15 +++++++ .../ViewModel/TaskViewModel.cs | 26 +++++++++++++ .../ViewModel/TeacherViewModel.cs | 28 +++++++++++++ 26 files changed, 524 insertions(+) create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/LessonBindingModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/MaterialBindingModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/ReportBindingModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TaskBindingModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TeacherBindingModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ILessonLogic.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IMaterialLogic.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IReportLogic.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITaskLogic.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITeacherLogic.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/SchoolAgainStudyContracts.csproj create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/LessonSearchModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/MaterialSearchModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TaskSearchModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TeacherSearchModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ILessonStorage.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/IMaterialStorage.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITaskStorage.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITeacherStorage.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/LessonViewModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/MaterialViewModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportDiyMaterialViewModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TaskViewModel.cs create mode 100644 SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TeacherViewModel.cs diff --git a/SchoolAgainStudy/SchoolAgainStudy.sln b/SchoolAgainStudy/SchoolAgainStudy.sln index 0321d8d..f9de9e6 100644 --- a/SchoolAgainStudy/SchoolAgainStudy.sln +++ b/SchoolAgainStudy/SchoolAgainStudy.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolAgainStudy", "SchoolA EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolAgainStudyDataModels", "SchoolAgainStudyDataModels\SchoolAgainStudyDataModels.csproj", "{F4F2EDE5-975A-4A60-8C1F-9AEF303AC0B3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolAgainStudyContracts", "SchoolAgainStudyContracts\SchoolAgainStudyContracts.csproj", "{5D678B52-4EDB-439A-BF15-E18280D39585}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {F4F2EDE5-975A-4A60-8C1F-9AEF303AC0B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F4F2EDE5-975A-4A60-8C1F-9AEF303AC0B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F4F2EDE5-975A-4A60-8C1F-9AEF303AC0B3}.Release|Any CPU.Build.0 = Release|Any CPU + {5D678B52-4EDB-439A-BF15-E18280D39585}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D678B52-4EDB-439A-BF15-E18280D39585}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D678B52-4EDB-439A-BF15-E18280D39585}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D678B52-4EDB-439A-BF15-E18280D39585}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/LessonBindingModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/LessonBindingModel.cs new file mode 100644 index 0000000..4a9f16c --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/LessonBindingModel.cs @@ -0,0 +1,25 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BindingModel +{ + public class LessonBindingModel : ILesson + { + public string Title { get; set; } = string.Empty; + + public DateTime DateEvent { get; set; } + + public int ProductId { get; set; } + public string ProductName { get; set; } = string.Empty; + + public int TeacherId { get; set; } + + public Dictionary LessonMaterials { get; set; } = new(); + + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/MaterialBindingModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/MaterialBindingModel.cs new file mode 100644 index 0000000..a7fa437 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/MaterialBindingModel.cs @@ -0,0 +1,18 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BindingModel +{ + public class MaterialBindingModel : IMaterial + { + public string Title { get; set; } = string.Empty; + + public string SphereUse { get; set; } = string.Empty; + + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/ReportBindingModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/ReportBindingModel.cs new file mode 100644 index 0000000..f89d3a8 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/ReportBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BindingModel +{ + public class ReportBindingModel + { + public string FileName { get; set; } = string.Empty; + + public DateTime? DateFrom { get; set; } + + public DateTime? DateTo { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TaskBindingModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TaskBindingModel.cs new file mode 100644 index 0000000..b543652 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TaskBindingModel.cs @@ -0,0 +1,24 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BindingModel +{ + public class TaskBindingModel : ITask + { + public string Title { get; set; } = string.Empty; + + public DateTime DateIssue { get; set; } + + public DateTime DateDelivery { get; set; } + + public int TeacherId { get; set; } + + public Dictionary TaskMaterials { get; set; } = new(); + + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TeacherBindingModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TeacherBindingModel.cs new file mode 100644 index 0000000..e78e294 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BindingModel/TeacherBindingModel.cs @@ -0,0 +1,26 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BindingModel +{ + public class TeacherBindingModel : ITeacher + { + public string Name { get; set; } = string.Empty; + + public string Post { get; set; } = string.Empty; + + public string Phone { get; set; } = string.Empty; + + public string Login { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public Dictionary TeacherMaterials { get; set; } = new(); + + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ILessonLogic.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ILessonLogic.cs new file mode 100644 index 0000000..8bef555 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ILessonLogic.cs @@ -0,0 +1,20 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BusinessLogicContracts +{ + 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/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IMaterialLogic.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IMaterialLogic.cs new file mode 100644 index 0000000..dc48e7c --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IMaterialLogic.cs @@ -0,0 +1,20 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BusinessLogicContracts +{ + public interface IMaterialLogic + { + List? ReadList(MaterialSearchModel? model); + MaterialViewModel? ReadElement(MaterialSearchModel model); + bool Create(MaterialBindingModel model); + bool Update(MaterialBindingModel model); + bool Delete(MaterialBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IReportLogic.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IReportLogic.cs new file mode 100644 index 0000000..b39efd9 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/IReportLogic.cs @@ -0,0 +1,39 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BusinessLogicContracts +{ + public interface IReportLogic + { + List GetInterestLesson(); + + + List GetOrders(ReportBindingModel model); + List GetDiyMaterial(); + + + List GetLessonTask(ReportBindingModel model); + + + void SaveInterestLessonToWordFile(ReportBindingModel model); + + + void SaveInterestLessonToExcelFile(ReportBindingModel model); + + + void SaveInterestsToPdfFile(ReportBindingModel model); + + void SaveDiyMaterialToWordFile(ReportBindingModel model); + + + void SaveDiyMaterialToExcelFile(ReportBindingModel model); + + + void SaveLessonTaskToPdfFile(ReportBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITaskLogic.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITaskLogic.cs new file mode 100644 index 0000000..ea1b067 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITaskLogic.cs @@ -0,0 +1,20 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BusinessLogicContracts +{ + public interface ITaskLogic + { + List? ReadList(TaskSearchModel? model); + TaskViewModel? ReadElement(TaskSearchModel model); + bool Create(TaskBindingModel model); + bool Update(TaskBindingModel model); + bool Delete(TaskBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITeacherLogic.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITeacherLogic.cs new file mode 100644 index 0000000..81cd454 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/BusinessLogicContracts/ITeacherLogic.cs @@ -0,0 +1,20 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.BusinessLogicContracts +{ + public interface ITeacherLogic + { + List? ReadList(TeacherSearchModel? model); + TeacherViewModel? ReadElement(TeacherSearchModel model); + bool Create(TeacherBindingModel model); + bool Update(TeacherBindingModel model); + bool Delete(TeacherBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/SchoolAgainStudyContracts.csproj b/SchoolAgainStudy/SchoolAgainStudyContracts/SchoolAgainStudyContracts.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/SchoolAgainStudyContracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/LessonSearchModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/LessonSearchModel.cs new file mode 100644 index 0000000..15df107 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/LessonSearchModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.SearchModel +{ + public class LessonSearchModel + { + public int? Id { get; set; } + public string? Title { get; set; } + public DateTime? DateFrom { get; set; } + + public DateTime? DateTo { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/MaterialSearchModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/MaterialSearchModel.cs new file mode 100644 index 0000000..9f557eb --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/MaterialSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.SearchModel +{ + public class MaterialSearchModel + { + public int? Id { get; set; } + public string? Title { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TaskSearchModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TaskSearchModel.cs new file mode 100644 index 0000000..fb6ea06 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TaskSearchModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.SearchModel +{ + public class TaskSearchModel + + { + public int? Id { get; set; } + public string? Title { get; set; } + public DateTime? DateFrom { get; set; } + + public DateTime? DateTo { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TeacherSearchModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TeacherSearchModel.cs new file mode 100644 index 0000000..53acce0 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/SearchModel/TeacherSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.SearchModel +{ + public class TeacherSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + public string? Name { get; set; } + + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ILessonStorage.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ILessonStorage.cs new file mode 100644 index 0000000..48485bb --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ILessonStorage.cs @@ -0,0 +1,21 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.StorageContracts +{ + 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/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/IMaterialStorage.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/IMaterialStorage.cs new file mode 100644 index 0000000..cd2bcec --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/IMaterialStorage.cs @@ -0,0 +1,21 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.StorageContracts +{ + public interface IMaterialStorage + { + List GetFullList(); + List GetFilteredList(MaterialSearchModel model); + MaterialViewModel? GetElement(MaterialSearchModel model); + MaterialViewModel? Insert(MaterialBindingModel model); + MaterialViewModel? Update(MaterialBindingModel model); + MaterialViewModel? Delete(MaterialBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITaskStorage.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITaskStorage.cs new file mode 100644 index 0000000..9530a85 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITaskStorage.cs @@ -0,0 +1,21 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.StorageContracts +{ + public interface ITaskStorage + { + List GetFullList(); + List GetFilteredList(TaskSearchModel model); + TaskViewModel? GetElement(TaskSearchModel model); + TaskViewModel? Insert(TaskBindingModel model); + TaskViewModel? Update(TaskBindingModel model); + TaskViewModel? Delete(TaskBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITeacherStorage.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITeacherStorage.cs new file mode 100644 index 0000000..c27e5f9 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/StorageContracts/ITeacherStorage.cs @@ -0,0 +1,21 @@ +using SchoolAgainStudyContracts.BindingModel; +using SchoolAgainStudyContracts.SearchModel; +using SchoolAgainStudyContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.StorageContracts +{ + public interface ITeacherStorage + { + List GetFullList(); + List GetFilteredList(TeacherSearchModel model); + TeacherViewModel? GetElement(TeacherSearchModel model); + TeacherViewModel? Insert(TeacherBindingModel model); + TeacherViewModel? Update(TeacherBindingModel model); + TeacherViewModel? Delete(TeacherBindingModel model); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/LessonViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/LessonViewModel.cs new file mode 100644 index 0000000..586803d --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/LessonViewModel.cs @@ -0,0 +1,28 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class LessonViewModel : ILesson + { + [DisplayName("Название")] + public string Title { get; set; } = string.Empty; + [DisplayName("Дата проведения")] + public DateTime DateEvent { get; set; } + + public int ProductId { get; set; } + [DisplayName("Изделие")] + public string ProductName { get; set; } = string.Empty; + + public int TeacherId { get; set; } + + public Dictionary LessonMaterials { get; set; } = new(); + [DisplayName("Номер")] + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/MaterialViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/MaterialViewModel.cs new file mode 100644 index 0000000..d85c1ed --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/MaterialViewModel.cs @@ -0,0 +1,20 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class MaterialViewModel : IMaterial + { + [DisplayName("Название")] + public string Title { get; set; } = string.Empty; + [DisplayName("Сфера использования")] + public string SphereUse { get; set; } = string.Empty; + [DisplayName("Номер")] + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportDiyMaterialViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportDiyMaterialViewModel.cs new file mode 100644 index 0000000..c8cdd90 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportDiyMaterialViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class ReportDiyMaterialViewModel + { + public string Title { get; set; } = string.Empty; + public List Diys { get; set; } = new(); + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs new file mode 100644 index 0000000..bd8e407 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class ReportLessonTaskViewModel + { + public int Id { get; set; } + public string TitleLesson { get; set; } = string.Empty; + public string TitleTask { get; set; } = string.Empty; + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TaskViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TaskViewModel.cs new file mode 100644 index 0000000..bfb9bba --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TaskViewModel.cs @@ -0,0 +1,26 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class TaskViewModel : ITask + { + [DisplayName("Название")] + public string Title { get; set; } = string.Empty; + [DisplayName("Дата выдачи")] + public DateTime DateIssue { get; set; } + [DisplayName("Дата сдачи")] + public DateTime DateDelivery { get; set; } + + public int TeacherId { get; set; } + + public Dictionary TaskMaterials { get; set; } = new(); + [DisplayName("Номер")] + public int Id { get; set; } + } +} diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TeacherViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TeacherViewModel.cs new file mode 100644 index 0000000..0061e21 --- /dev/null +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/TeacherViewModel.cs @@ -0,0 +1,28 @@ +using SchoolAgainStudyDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SchoolAgainStudyContracts.ViewModel +{ + public class TeacherViewModel : ITeacher + { + [DisplayName("ФИО")] + public string Name { get; set; } = string.Empty; + [DisplayName("Должность")] + public string Post { get; set; } = string.Empty; + [DisplayName("Телефон")] + public string Phone { get; set; } = string.Empty; + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + public Dictionary TeacherMaterials { get; set; } = new(); + [DisplayName("Номер")] + public int Id { get; set; } + } +}