From 9dee23c18acfc67081a7e55364005b8595fa92f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B0=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A4=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Thu, 18 Apr 2024 21:44:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D1=80=D0=B0=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LawFim/LawFim.sln | 8 ++++++- LawFim/LawFimDataModels/Models/IRoleModel.cs | 7 ------ LawFim/LawFimDataModels/Models/IUserModel.cs | 10 --------- .../BindingModels/CaseBindingModel.cs | 16 ++++++++++++++ .../BindingModels/ClientBindingModel.cs | 12 ++++++++++ .../BindingModels/VisitBindingModel.cs | 12 ++++++++++ .../BusinessLogicContracts/ICaseLogic.cs | 20 +++++++++++++++++ .../BusinessLogicContracts/IClientLogic.cs | 17 ++++++++++++++ .../BusinessLogicContracts/IVisitLogic.cs | 17 ++++++++++++++ .../LawFirmContracts/LawFirmContracts.csproj | 13 +++++++++++ .../SearchModels/CaseSearchModel.cs | 11 ++++++++++ .../SearchModels/ClientSearchModel.cs | 10 +++++++++ .../SearchModels/VisitSearchModel.cs | 9 ++++++++ .../StoragesContracts/ICaseStorage.cs | 16 ++++++++++++++ .../StoragesContracts/IClientStorage.cs | 18 +++++++++++++++ .../StoragesContracts/IVisitStorage.cs | 16 ++++++++++++++ .../ViewModels/CaseViewModel.cs | 22 +++++++++++++++++++ .../ViewModels/ClientViewModel.cs | 16 ++++++++++++++ .../ViewModels/VisitViewModel.cs | 14 ++++++++++++ 19 files changed, 246 insertions(+), 18 deletions(-) delete mode 100644 LawFim/LawFimDataModels/Models/IRoleModel.cs delete mode 100644 LawFim/LawFimDataModels/Models/IUserModel.cs create mode 100644 LawFim/LawFirmContracts/BindingModels/CaseBindingModel.cs create mode 100644 LawFim/LawFirmContracts/BindingModels/ClientBindingModel.cs create mode 100644 LawFim/LawFirmContracts/BindingModels/VisitBindingModel.cs create mode 100644 LawFim/LawFirmContracts/BusinessLogicContracts/ICaseLogic.cs create mode 100644 LawFim/LawFirmContracts/BusinessLogicContracts/IClientLogic.cs create mode 100644 LawFim/LawFirmContracts/BusinessLogicContracts/IVisitLogic.cs create mode 100644 LawFim/LawFirmContracts/LawFirmContracts.csproj create mode 100644 LawFim/LawFirmContracts/SearchModels/CaseSearchModel.cs create mode 100644 LawFim/LawFirmContracts/SearchModels/ClientSearchModel.cs create mode 100644 LawFim/LawFirmContracts/SearchModels/VisitSearchModel.cs create mode 100644 LawFim/LawFirmContracts/StoragesContracts/ICaseStorage.cs create mode 100644 LawFim/LawFirmContracts/StoragesContracts/IClientStorage.cs create mode 100644 LawFim/LawFirmContracts/StoragesContracts/IVisitStorage.cs create mode 100644 LawFim/LawFirmContracts/ViewModels/CaseViewModel.cs create mode 100644 LawFim/LawFirmContracts/ViewModels/ClientViewModel.cs create mode 100644 LawFim/LawFirmContracts/ViewModels/VisitViewModel.cs diff --git a/LawFim/LawFim.sln b/LawFim/LawFim.sln index 3f540da..2df2ded 100644 --- a/LawFim/LawFim.sln +++ b/LawFim/LawFim.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.7.34024.191 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 Global 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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/LawFim/LawFimDataModels/Models/IRoleModel.cs b/LawFim/LawFimDataModels/Models/IRoleModel.cs deleted file mode 100644 index 38bd1c6..0000000 --- a/LawFim/LawFimDataModels/Models/IRoleModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LawFimDataModels.Models -{ - public interface IRoleModel : IId - { - string Name { get; } - } -} diff --git a/LawFim/LawFimDataModels/Models/IUserModel.cs b/LawFim/LawFimDataModels/Models/IUserModel.cs deleted file mode 100644 index 2c311b0..0000000 --- a/LawFim/LawFimDataModels/Models/IUserModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace LawFimDataModels.Models -{ - public interface IUserModel : IId - { - string FIO { get; } - string Email { get; } - string Password { get; } - int RoleId { get; } - } -} diff --git a/LawFim/LawFirmContracts/BindingModels/CaseBindingModel.cs b/LawFim/LawFirmContracts/BindingModels/CaseBindingModel.cs new file mode 100644 index 0000000..39df803 --- /dev/null +++ b/LawFim/LawFirmContracts/BindingModels/CaseBindingModel.cs @@ -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 CaseClients { get; set; } = new(); + } +} diff --git a/LawFim/LawFirmContracts/BindingModels/ClientBindingModel.cs b/LawFim/LawFirmContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..7df2dc1 --- /dev/null +++ b/LawFim/LawFirmContracts/BindingModels/ClientBindingModel.cs @@ -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; + } +} diff --git a/LawFim/LawFirmContracts/BindingModels/VisitBindingModel.cs b/LawFim/LawFirmContracts/BindingModels/VisitBindingModel.cs new file mode 100644 index 0000000..e701744 --- /dev/null +++ b/LawFim/LawFirmContracts/BindingModels/VisitBindingModel.cs @@ -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 VisitClients { get; set; } = new(); + } +} diff --git a/LawFim/LawFirmContracts/BusinessLogicContracts/ICaseLogic.cs b/LawFim/LawFirmContracts/BusinessLogicContracts/ICaseLogic.cs new file mode 100644 index 0000000..052983c --- /dev/null +++ b/LawFim/LawFirmContracts/BusinessLogicContracts/ICaseLogic.cs @@ -0,0 +1,20 @@ +using LawFimDataModels.Models; +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.BusinessLogicContracts +{ + public interface ICaseLogic + { + List? 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); + } +} diff --git a/LawFim/LawFirmContracts/BusinessLogicContracts/IClientLogic.cs b/LawFim/LawFirmContracts/BusinessLogicContracts/IClientLogic.cs new file mode 100644 index 0000000..568c283 --- /dev/null +++ b/LawFim/LawFirmContracts/BusinessLogicContracts/IClientLogic.cs @@ -0,0 +1,17 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.BusinessLogicContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + List? ReadCaseElementList(CaseSearchModel? model); + List? ReadVisitElementList(VisitSearchModel? model); + ClientViewModel? ReadElement(ClientSearchModel model); + bool Create(ClientBindingModel model); + bool Update(ClientBindingModel model); + bool Delete(ClientBindingModel model); + } +} diff --git a/LawFim/LawFirmContracts/BusinessLogicContracts/IVisitLogic.cs b/LawFim/LawFirmContracts/BusinessLogicContracts/IVisitLogic.cs new file mode 100644 index 0000000..b118c8e --- /dev/null +++ b/LawFim/LawFirmContracts/BusinessLogicContracts/IVisitLogic.cs @@ -0,0 +1,17 @@ +using LawFimDataModels.Models; +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.BusinessLogicContracts +{ + public interface IVisitLogic + { + List? 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); + } +} diff --git a/LawFim/LawFirmContracts/LawFirmContracts.csproj b/LawFim/LawFirmContracts/LawFirmContracts.csproj new file mode 100644 index 0000000..d5cfabb --- /dev/null +++ b/LawFim/LawFirmContracts/LawFirmContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/LawFim/LawFirmContracts/SearchModels/CaseSearchModel.cs b/LawFim/LawFirmContracts/SearchModels/CaseSearchModel.cs new file mode 100644 index 0000000..4ae6a92 --- /dev/null +++ b/LawFim/LawFirmContracts/SearchModels/CaseSearchModel.cs @@ -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; } + } +} diff --git a/LawFim/LawFirmContracts/SearchModels/ClientSearchModel.cs b/LawFim/LawFirmContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..5a8ab7b --- /dev/null +++ b/LawFim/LawFirmContracts/SearchModels/ClientSearchModel.cs @@ -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; } + } +} diff --git a/LawFim/LawFirmContracts/SearchModels/VisitSearchModel.cs b/LawFim/LawFirmContracts/SearchModels/VisitSearchModel.cs new file mode 100644 index 0000000..3c96330 --- /dev/null +++ b/LawFim/LawFirmContracts/SearchModels/VisitSearchModel.cs @@ -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; } + } +} diff --git a/LawFim/LawFirmContracts/StoragesContracts/ICaseStorage.cs b/LawFim/LawFirmContracts/StoragesContracts/ICaseStorage.cs new file mode 100644 index 0000000..e82834c --- /dev/null +++ b/LawFim/LawFirmContracts/StoragesContracts/ICaseStorage.cs @@ -0,0 +1,16 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.StoragesContracts +{ + public interface ICaseStorage + { + List GetFullList(); + List GetFilteredList(CaseSearchModel model); + CaseViewModel? GetElement(CaseSearchModel model); + CaseViewModel? Insert(CaseBindingModel model); + CaseViewModel? Update(CaseBindingModel model); + CaseViewModel? Delete(CaseBindingModel model); + } +} diff --git a/LawFim/LawFirmContracts/StoragesContracts/IClientStorage.cs b/LawFim/LawFirmContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..83108ca --- /dev/null +++ b/LawFim/LawFirmContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,18 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.StoragesContracts +{ + public interface IClientStorage + { + List GetFullList(); + List GetFilteredList(ClientSearchModel model); + List GetClientCaseList(CaseSearchModel model); + List GetClientVisitList(VisitSearchModel model); + ClientViewModel? GetElement(ClientSearchModel model); + ClientViewModel? Insert(ClientBindingModel model); + ClientViewModel? Update(ClientBindingModel model); + ClientViewModel? Delete(ClientBindingModel model); + } +} diff --git a/LawFim/LawFirmContracts/StoragesContracts/IVisitStorage.cs b/LawFim/LawFirmContracts/StoragesContracts/IVisitStorage.cs new file mode 100644 index 0000000..e31ab26 --- /dev/null +++ b/LawFim/LawFirmContracts/StoragesContracts/IVisitStorage.cs @@ -0,0 +1,16 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.StoragesContracts +{ + public interface IVisitStorage + { + List GetFullList(); + List GetFilteredList(VisitSearchModel model); + VisitViewModel? GetElement(VisitSearchModel model); + VisitViewModel? Insert(VisitBindingModel model); + VisitViewModel? Update(VisitBindingModel model); + VisitViewModel? Delete(VisitBindingModel model); + } +} diff --git a/LawFim/LawFirmContracts/ViewModels/CaseViewModel.cs b/LawFim/LawFirmContracts/ViewModels/CaseViewModel.cs new file mode 100644 index 0000000..80ed018 --- /dev/null +++ b/LawFim/LawFirmContracts/ViewModels/CaseViewModel.cs @@ -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 CaseClients { get; set; } = new(); + } +} diff --git a/LawFim/LawFirmContracts/ViewModels/ClientViewModel.cs b/LawFim/LawFirmContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..45eefe2 --- /dev/null +++ b/LawFim/LawFirmContracts/ViewModels/ClientViewModel.cs @@ -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; + } +} diff --git a/LawFim/LawFirmContracts/ViewModels/VisitViewModel.cs b/LawFim/LawFirmContracts/ViewModels/VisitViewModel.cs new file mode 100644 index 0000000..91a6274 --- /dev/null +++ b/LawFim/LawFirmContracts/ViewModels/VisitViewModel.cs @@ -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 VisitClients { get; set; } = new(); + } +}