From d77baa2273f706bd62eb4529b3a40003e6ed6a5c Mon Sep 17 00:00:00 2001 From: ElEgEv <112943269+ElEgEv@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:13:02 +0400 Subject: [PATCH] Add new lib. --- .../BindingModel/LabWorkBindingModel.cs | 33 +++++++++++++++++++ .../Contracts/Contracts.csproj | 13 ++++++++ .../SearchModel/LabWorkSearchModel.cs | 15 +++++++++ .../StorageContracts/ILabWorkStorage.cs | 26 +++++++++++++++ .../Contracts/ViewModel/LabWorkViewModel.cs | 33 +++++++++++++++++++ .../DataModels/DataModels.csproj | 4 --- .../DataModels/Models/ILabWork.cs | 21 ++++++++++++ VisualComponentsForm/VisualComponentsForm.sln | 9 +++++ 8 files changed, 150 insertions(+), 4 deletions(-) create mode 100644 VisualComponentsForm/Contracts/BindingModel/LabWorkBindingModel.cs create mode 100644 VisualComponentsForm/Contracts/Contracts.csproj create mode 100644 VisualComponentsForm/Contracts/SearchModel/LabWorkSearchModel.cs create mode 100644 VisualComponentsForm/Contracts/StorageContracts/ILabWorkStorage.cs create mode 100644 VisualComponentsForm/Contracts/ViewModel/LabWorkViewModel.cs create mode 100644 VisualComponentsForm/DataModels/Models/ILabWork.cs diff --git a/VisualComponentsForm/Contracts/BindingModel/LabWorkBindingModel.cs b/VisualComponentsForm/Contracts/BindingModel/LabWorkBindingModel.cs new file mode 100644 index 0000000..1dc124c --- /dev/null +++ b/VisualComponentsForm/Contracts/BindingModel/LabWorkBindingModel.cs @@ -0,0 +1,33 @@ +using DataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModel +{ + public class LabWorkBindingModel : ILabWork + { + public int Id {get; set; } + + public string Theme { get; set; } = string.Empty; + + public List FCs { get; set; } + + public List Disciplines { get; set; } + + public string[] Questions { get; set; } + + public LabWorkBindingModel() { } + + public LabWorkBindingModel(ILabWork labWork) + { + Id = labWork.Id; + Theme = labWork.Theme; + FCs = labWork.FCs; + Disciplines = labWork.Disciplines; + Questions = labWork.Questions; + } + } +} diff --git a/VisualComponentsForm/Contracts/Contracts.csproj b/VisualComponentsForm/Contracts/Contracts.csproj new file mode 100644 index 0000000..aa777b6 --- /dev/null +++ b/VisualComponentsForm/Contracts/Contracts.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/VisualComponentsForm/Contracts/SearchModel/LabWorkSearchModel.cs b/VisualComponentsForm/Contracts/SearchModel/LabWorkSearchModel.cs new file mode 100644 index 0000000..ce5781a --- /dev/null +++ b/VisualComponentsForm/Contracts/SearchModel/LabWorkSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.SearchModel +{ + public class LabWorkSearchModel + { + public int? Id { get; set; } + + public string? Theme { get; set; } + } +} diff --git a/VisualComponentsForm/Contracts/StorageContracts/ILabWorkStorage.cs b/VisualComponentsForm/Contracts/StorageContracts/ILabWorkStorage.cs new file mode 100644 index 0000000..f3e0e96 --- /dev/null +++ b/VisualComponentsForm/Contracts/StorageContracts/ILabWorkStorage.cs @@ -0,0 +1,26 @@ +using Contracts.BindingModel; +using Contracts.SearchModel; +using Contracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.StorageContracts +{ + public interface ILabWorkStorage + { + List GetFullList(); + + LabWorkViewModel? GetElement(LabWorkSearchModel model); + + List GetFilteredList(LabWorkSearchModel model); + + LabWorkViewModel? Insert(LabWorkBindingModel model); + + LabWorkViewModel? Update(LabWorkBindingModel model); + + LabWorkViewModel? Delete(LabWorkBindingModel model); + } +} diff --git a/VisualComponentsForm/Contracts/ViewModel/LabWorkViewModel.cs b/VisualComponentsForm/Contracts/ViewModel/LabWorkViewModel.cs new file mode 100644 index 0000000..560e10d --- /dev/null +++ b/VisualComponentsForm/Contracts/ViewModel/LabWorkViewModel.cs @@ -0,0 +1,33 @@ +using DataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.ViewModel +{ + public class LabWorkViewModel + { + public int Id { get; set; } + + public string Theme { get; set; } = string.Empty; + + public List FCs { get; set; } + + public List Disciplines { get; set; } + + public string[] Questions { get; set; } + + public LabWorkViewModel() { } + + public LabWorkViewModel(ILabWork labWork) + { + Id = labWork.Id; + Theme = labWork.Theme; + FCs = labWork.FCs; + Disciplines = labWork.Disciplines; + Questions = labWork.Questions; + } + } +} diff --git a/VisualComponentsForm/DataModels/DataModels.csproj b/VisualComponentsForm/DataModels/DataModels.csproj index 3a91e20..cfadb03 100644 --- a/VisualComponentsForm/DataModels/DataModels.csproj +++ b/VisualComponentsForm/DataModels/DataModels.csproj @@ -6,8 +6,4 @@ enable - - - - diff --git a/VisualComponentsForm/DataModels/Models/ILabWork.cs b/VisualComponentsForm/DataModels/Models/ILabWork.cs new file mode 100644 index 0000000..3497c0e --- /dev/null +++ b/VisualComponentsForm/DataModels/Models/ILabWork.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataModels.Models +{ + public interface ILabWork : IId + { + string Theme { get; } + + //ФИО + List FCs { get; } + + List Disciplines { get; } + + //Вопросы по лабораторной + string[] Questions { get; } + } +} diff --git a/VisualComponentsForm/VisualComponentsForm.sln b/VisualComponentsForm/VisualComponentsForm.sln index 4fde77b..8336f1c 100644 --- a/VisualComponentsForm/VisualComponentsForm.sln +++ b/VisualComponentsForm/VisualComponentsForm.sln @@ -9,6 +9,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualComponentsLib", "..\V EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataModels", "DataModels\DataModels.csproj", "{D208DBE1-5E90-4611-BAFD-2B021BCE0ADA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "Contracts\Contracts.csproj", "{E78467E3-3100-4F40-B454-7C44CB49FAB4}" + ProjectSection(ProjectDependencies) = postProject + {D208DBE1-5E90-4611-BAFD-2B021BCE0ADA} = {D208DBE1-5E90-4611-BAFD-2B021BCE0ADA} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +32,10 @@ Global {D208DBE1-5E90-4611-BAFD-2B021BCE0ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU {D208DBE1-5E90-4611-BAFD-2B021BCE0ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU {D208DBE1-5E90-4611-BAFD-2B021BCE0ADA}.Release|Any CPU.Build.0 = Release|Any CPU + {E78467E3-3100-4F40-B454-7C44CB49FAB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E78467E3-3100-4F40-B454-7C44CB49FAB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E78467E3-3100-4F40-B454-7C44CB49FAB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E78467E3-3100-4F40-B454-7C44CB49FAB4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE