Add new lib.

This commit is contained in:
ElEgEv 2023-10-20 23:13:02 +04:00
parent 352635edf0
commit d77baa2273
8 changed files with 150 additions and 4 deletions

View File

@ -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<string> FCs { get; set; }
public List<string> 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;
}
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DataModels\DataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -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; }
}
}

View File

@ -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<LabWorkViewModel> GetFullList();
LabWorkViewModel? GetElement(LabWorkSearchModel model);
List<LabWorkViewModel> GetFilteredList(LabWorkSearchModel model);
LabWorkViewModel? Insert(LabWorkBindingModel model);
LabWorkViewModel? Update(LabWorkBindingModel model);
LabWorkViewModel? Delete(LabWorkBindingModel model);
}
}

View File

@ -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<string> FCs { get; set; }
public List<string> 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;
}
}
}

View File

@ -6,8 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
</Project>

View File

@ -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<string> FCs { get; }
List<string> Disciplines { get; }
//Вопросы по лабораторной
string[] Questions { get; }
}
}

View File

@ -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