контракты раз

This commit is contained in:
Галина Федоренко 2024-04-18 21:44:46 +04:00
parent 37383c61c7
commit 9dee23c18a
19 changed files with 246 additions and 18 deletions

View File

@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.7.34024.191 VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawFimDataModels", "LawFimDataModels\LawFimDataModels.csproj", "{CE9CFF55-C5BC-4089-A425-1823AE4E74DD}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawFimDataModels", "LawFimDataModels\LawFimDataModels.csproj", "{CE9CFF55-C5BC-4089-A425-1823AE4E74DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawFirmContracts", "LawFirmContracts\LawFirmContracts.csproj", "{61348245-9074-4C17-9698-7603F41E1D94}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,6 +17,10 @@ Global
{CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Debug|Any CPU.Build.0 = Debug|Any CPU {CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Release|Any CPU.Build.0 = Release|Any CPU {CE9CFF55-C5BC-4089-A425-1823AE4E74DD}.Release|Any CPU.Build.0 = Release|Any CPU
{61348245-9074-4C17-9698-7603F41E1D94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61348245-9074-4C17-9698-7603F41E1D94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61348245-9074-4C17-9698-7603F41E1D94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61348245-9074-4C17-9698-7603F41E1D94}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,7 +0,0 @@
namespace LawFimDataModels.Models
{
public interface IRoleModel : IId
{
string Name { get; }
}
}

View File

@ -1,10 +0,0 @@
namespace LawFimDataModels.Models
{
public interface IUserModel : IId
{
string FIO { get; }
string Email { get; }
string Password { get; }
int RoleId { get; }
}
}

View File

@ -0,0 +1,16 @@
using LawFimDataModels.Enums;
using LawFimDataModels.Models;
namespace LawFirmContracts.BindingModels
{
public class CaseBindingModel : ICaseModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public CaseStatus Status { get; set; } = CaseStatus.Неизвестен;
public string CaseType { get; set; } = string.Empty;
public DateTime DateCreate { get; set; }
public DateTime? DateImplement { get; set; }
public Dictionary<int, IClientModel> CaseClients { get; set; } = new();
}
}

View File

@ -0,0 +1,12 @@
using LawFimDataModels.Models;
namespace LawFirmContracts.BindingModels
{
public class ClientBindingModel : IClientModel
{
public int Id { get; set; }
public string FIO { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using LawFimDataModels.Models;
namespace LawFirmContracts.BindingModels
{
public class VisitBindingModel : IVisitModel
{
public int Id { get; set; }
public DateTime VisitDate { get; set; }
public int HearingId { get; set; }
public Dictionary<int, IClientModel> VisitClients { get; set; } = new();
}
}

View File

@ -0,0 +1,20 @@
using LawFimDataModels.Models;
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.BusinessLogicContracts
{
public interface ICaseLogic
{
List<CaseViewModel>? ReadList(CaseSearchModel? model);
CaseViewModel? ReadElement(CaseSearchModel model);
bool CreateCase(CaseBindingModel model);
bool CaseAnalysis(CaseBindingModel model);
bool CaseHearing(CaseBindingModel model);
bool CloseCase(CaseBindingModel model);
bool DeleteCase(CaseBindingModel model);
bool AddClientToCase(CaseSearchModel model, IClientModel client);
bool Update(CaseBindingModel model);
}
}

View File

@ -0,0 +1,17 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.BusinessLogicContracts
{
public interface IClientLogic
{
List<ClientViewModel>? ReadList(ClientSearchModel? model);
List<ClientViewModel>? ReadCaseElementList(CaseSearchModel? model);
List<ClientViewModel>? ReadVisitElementList(VisitSearchModel? model);
ClientViewModel? ReadElement(ClientSearchModel model);
bool Create(ClientBindingModel model);
bool Update(ClientBindingModel model);
bool Delete(ClientBindingModel model);
}
}

View File

@ -0,0 +1,17 @@
using LawFimDataModels.Models;
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.BusinessLogicContracts
{
public interface IVisitLogic
{
List<VisitViewModel>? ReadList(VisitSearchModel? model);
VisitViewModel? ReadElement(VisitSearchModel model);
bool Create(VisitBindingModel model);
bool Update(VisitBindingModel model);
bool Delete(VisitBindingModel model);
bool AddClientToVisit(VisitSearchModel model, IClientModel client);
}
}

View File

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

View File

@ -0,0 +1,11 @@
namespace LawFirmContracts.SearchModels
{
public class CaseSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
public string? CaseType { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,10 @@
namespace LawFirmContracts.SearchModels
{
public class ClientSearchModel
{
public int? Id { get; set; }
public string? FIO { get; set; }
public string? Phone { get; set; }
public string? Email { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace LawFirmContracts.SearchModels
{
public class VisitSearchModel
{
public int? Id { get; set; }
public DateTime? VisitDate { get; set; }
public int? HearingId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.StoragesContracts
{
public interface ICaseStorage
{
List<CaseViewModel> GetFullList();
List<CaseViewModel> GetFilteredList(CaseSearchModel model);
CaseViewModel? GetElement(CaseSearchModel model);
CaseViewModel? Insert(CaseBindingModel model);
CaseViewModel? Update(CaseBindingModel model);
CaseViewModel? Delete(CaseBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.StoragesContracts
{
public interface IClientStorage
{
List<ClientViewModel> GetFullList();
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
List<ClientViewModel> GetClientCaseList(CaseSearchModel model);
List<ClientViewModel> GetClientVisitList(VisitSearchModel model);
ClientViewModel? GetElement(ClientSearchModel model);
ClientViewModel? Insert(ClientBindingModel model);
ClientViewModel? Update(ClientBindingModel model);
ClientViewModel? Delete(ClientBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
namespace LawFirmContracts.StoragesContracts
{
public interface IVisitStorage
{
List<VisitViewModel> GetFullList();
List<VisitViewModel> GetFilteredList(VisitSearchModel model);
VisitViewModel? GetElement(VisitSearchModel model);
VisitViewModel? Insert(VisitBindingModel model);
VisitViewModel? Update(VisitBindingModel model);
VisitViewModel? Delete(VisitBindingModel model);
}
}

View File

@ -0,0 +1,22 @@
using LawFimDataModels.Enums;
using LawFimDataModels.Models;
using System.ComponentModel;
namespace LawFirmContracts.ViewModels
{
public class CaseViewModel : ICaseModel
{
public int Id { get; set; }
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Статус")]
public CaseStatus Status { get; set; } = CaseStatus.Неизвестен;
[DisplayName("Вид производства")]
public string CaseType { get; set; } = string.Empty;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; }
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
public Dictionary<int, IClientModel> CaseClients { get; set; } = new();
}
}

View File

@ -0,0 +1,16 @@
using LawFimDataModels.Models;
using System.ComponentModel;
namespace LawFirmContracts.ViewModels
{
public class ClientViewModel : IClientModel
{
public int Id { get; set; }
[DisplayName("ФИО клиента")]
public string FIO { get; set; } = string.Empty;
[DisplayName("Email клиента")]
public string Email { get; set; } = string.Empty;
[DisplayName("Телефон клиента")]
public string Phone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,14 @@
using LawFimDataModels.Models;
using System.ComponentModel;
namespace LawFirmContracts.ViewModels
{
public class VisitViewModel : IVisitModel
{
public int Id { get; set; }
[DisplayName("Дата визита")]
public DateTime VisitDate { get; set; }
public int HearingId { get; set; }
public Dictionary<int, IClientModel> VisitClients { get; set; } = new();
}
}