1 часть

This commit is contained in:
AnnaLioness 2024-02-11 02:23:45 +04:00
parent f153b853c3
commit 52c75ab568
25 changed files with 467 additions and 5 deletions

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractLawFirmContracts", "AbstractLawFirmContracts\AbstractLawFirmContracts.csproj", "{32D95EAA-926F-4BFA-A0A9-128BA0260A66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{32D95EAA-926F-4BFA-A0A9-128BA0260A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32D95EAA-926F-4BFA-A0A9-128BA0260A66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32D95EAA-926F-4BFA-A0A9-128BA0260A66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32D95EAA-926F-4BFA-A0A9-128BA0260A66}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA33641B-AC1E-42E6-BA74-A1A91DAF198E}
EndGlobalSection
EndGlobal

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="..\..\AbstractLawFirmDataModels\AbstractLawFirmDataModels\LawFirmDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,16 @@
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BindingModels.BindingModels
{
public class ComponentBindingModel : IComponentModel
{
public int Id { get; set; }
public string ComponentName { get; set; } = string.Empty;
public double Cost { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BindingModels
{
public class DocumentBindingModel : IDocumentModel
{
public int Id { get; set; }
public string DocumentName { get; set; } = string.Empty;
public double Price { get; set; }
public Dictionary<int, (IComponentModel, int)> DocumentComponents
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,21 @@
using LawFirmDataModels.Enums;
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BindingModels
{
public class OrderBindingModel : IOrderModel
{
public int Id { get; set; }
public int DocumentId { get; set; }
public int Count { get; set; }
public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public DateTime DateCreate { get; set; } = DateTime.Now;
public DateTime? DateImplement { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using LawFirmContracts.BindingModels.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BusinessLogicsContracts
{
public interface IComponentLogic
{
List<ComponentViewModel>? ReadList(ComponentSearchModel? model);
ComponentViewModel? ReadElement(ComponentSearchModel model);
bool Create(ComponentBindingModel model);
bool Update(ComponentBindingModel model);
bool Delete(ComponentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BusinessLogicsContracts
{
public interface IDocumentLogic
{
List<DocumentViewModel>? ReadList(DocumentSearchModel? model);
DocumentViewModel? ReadElement(DocumentSearchModel model);
bool Create(DocumentBindingModel model);
bool Update(DocumentBindingModel model);
bool Delete(DocumentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.BusinessLogicsContracts
{
public interface IOrderLogic
{
List<OrderViewModel>? ReadList(OrderSearchModel? model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model);
bool DeliveryOrder(OrderBindingModel model);
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.SearchModels
{
public class ComponentSearchModel
{
public int? Id { get; set; }
public string? ComponentName { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.SearchModels
{
public class DocumentSearchModel
{
public int? Id { get; set; }
public string? ProductName { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.SearchModels
{
public class OrderSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using LawFirmContracts.BindingModels.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.StoragesContracts
{
public interface IComponentStorage
{
List<ComponentViewModel> GetFullList();
List<ComponentViewModel> GetFilteredList(ComponentSearchModel model);
ComponentViewModel? GetElement(ComponentSearchModel model);
ComponentViewModel? Insert(ComponentBindingModel model);
ComponentViewModel? Update(ComponentBindingModel model);
ComponentViewModel? Delete(ComponentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.StoragesContracts
{
public interface IDocumentStorage
{
List<DocumentViewModel> GetFullList();
List<DocumentViewModel> GetFilteredList(DocumentSearchModel model);
DocumentViewModel? GetElement(DocumentSearchModel model);
DocumentViewModel? Insert(DocumentSearchModel model);
DocumentViewModel? Update(DocumentSearchModel model);
DocumentViewModel? Delete(DocumentSearchModel model);
}
}

View File

@ -0,0 +1,21 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.SearchModels;
using LawFirmContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.StoragesContracts
{
public interface IOrderStorage
{
List<OrderViewModel> GetFullList();
List<OrderViewModel> GetFilteredList(OrderSearchModel model);
OrderViewModel? GetElement(OrderSearchModel model);
OrderViewModel? Insert(OrderBindingModel model);
OrderViewModel? Update(OrderBindingModel model);
OrderViewModel? Delete(OrderBindingModel model);
}
}

View File

@ -0,0 +1,19 @@
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.ViewModels
{
public class ComponentViewModel : IComponentModel
{
public int Id { get; set; }
[DisplayName("Название бланка")]
public string ComponentName { get; set; } = string.Empty;
[DisplayName("Цена")]
public double Cost { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.ViewModels
{
public class DocumentViewModel : IDocumentModel
{
public int Id { get; set; }
[DisplayName("Название пакета документов")]
public string DocumentName { get; set; } = string.Empty;
[DisplayName("Цена")]
public double Price { get; set; }
public Dictionary<int, (IComponentModel, int)> DocumentComponents
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,30 @@
using LawFirmDataModels.Enums;
using LawFirmDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
[DisplayName("Номер")]
public int Id { get; set; }
public int DocumentId { get; set; }
[DisplayName("Пакет документов")]
public string ProductName { get; set; } = string.Empty;
[DisplayName("Количество")]
public int Count { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
[DisplayName("Статус")]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; } = DateTime.Now;
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractLawFirmDataModels", "AbstractLawFirmDataModels\AbstractLawFirmDataModels.csproj", "{9CA9492B-F2F5-40A3-821B-F7EC14AEFE5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9CA9492B-F2F5-40A3-821B-F7EC14AEFE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CA9492B-F2F5-40A3-821B-F7EC14AEFE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CA9492B-F2F5-40A3-821B-F7EC14AEFE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CA9492B-F2F5-40A3-821B-F7EC14AEFE5D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3F1F2B80-1FE8-42C3-9167-E2E50274FE15}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmDataModels.Enums
{
public enum OrderStatus
{
Неизвестен = -1,
Принят = 0,
Выполняется = 1,
Готов = 2,
Выдан = 3
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmDataModels
{
public interface IId
{
int Id { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LawFirmDataModels;
namespace LawFirmDataModels.Models
{
public interface IComponentModel : IId
{
string ComponentName { get; }
double Cost { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LawFirmDataModels;
namespace LawFirmDataModels.Models
{
public interface IDocumentModel : IId
{
string DocumentName { get; }
double Price { get; }
Dictionary<int, (IComponentModel, int)> DocumentComponents { get; }
}
}

View File

@ -0,0 +1,21 @@
using LawFirmDataModels;
using LawFirmDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmDataModels.Models
{
public interface IOrderModel : IId
{
int DocumentId { get; }
int Count { get; }
double Sum { get; }
OrderStatus Status { get; }
DateTime DateCreate { get; }
DateTime? DateImplement { get; }
}
}

View File

@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawFirm", "LawFirm\LawFirm.csproj", "{37E3649B-C56A-4E69-9C69-2A68285FCD0D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawFirmView", "LawFirmView\LawFirmView.csproj", "{32CEC3FF-22BE-4DCD-8955-E3B14953EA67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawFirmDataModels", "AbstractLawFirmDataModels\AbstractLawFirmDataModels\LawFirmDataModels.csproj", "{99CE17B9-0CCE-42B6-B73F-61E8D49F1AAB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawFirmContracts", "AbstractLawFirmContracts\AbstractLawFirmContracts\LawFirmContracts.csproj", "{C0155B2E-5974-4835-996B-6FDF0F5BC06B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,10 +15,18 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{37E3649B-C56A-4E69-9C69-2A68285FCD0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37E3649B-C56A-4E69-9C69-2A68285FCD0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37E3649B-C56A-4E69-9C69-2A68285FCD0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37E3649B-C56A-4E69-9C69-2A68285FCD0D}.Release|Any CPU.Build.0 = Release|Any CPU
{32CEC3FF-22BE-4DCD-8955-E3B14953EA67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32CEC3FF-22BE-4DCD-8955-E3B14953EA67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32CEC3FF-22BE-4DCD-8955-E3B14953EA67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32CEC3FF-22BE-4DCD-8955-E3B14953EA67}.Release|Any CPU.Build.0 = Release|Any CPU
{99CE17B9-0CCE-42B6-B73F-61E8D49F1AAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99CE17B9-0CCE-42B6-B73F-61E8D49F1AAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99CE17B9-0CCE-42B6-B73F-61E8D49F1AAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99CE17B9-0CCE-42B6-B73F-61E8D49F1AAB}.Release|Any CPU.Build.0 = Release|Any CPU
{C0155B2E-5974-4835-996B-6FDF0F5BC06B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0155B2E-5974-4835-996B-6FDF0F5BC06B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0155B2E-5974-4835-996B-6FDF0F5BC06B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C0155B2E-5974-4835-996B-6FDF0F5BC06B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE