diff --git a/Factory.sln b/Factory.sln new file mode 100644 index 0000000..f230987 --- /dev/null +++ b/Factory.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33110.190 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactoryDataModels", "FactoryDataModels\FactoryDataModels.csproj", "{CBE4843B-F023-4C97-925E-BEFE960D0EEA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactoryContracts", "FactoryContracts\FactoryContracts.csproj", "{87BA79A9-CF35-4CB4-98BD-86C01918C81C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CBE4843B-F023-4C97-925E-BEFE960D0EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBE4843B-F023-4C97-925E-BEFE960D0EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBE4843B-F023-4C97-925E-BEFE960D0EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBE4843B-F023-4C97-925E-BEFE960D0EEA}.Release|Any CPU.Build.0 = Release|Any CPU + {87BA79A9-CF35-4CB4-98BD-86C01918C81C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87BA79A9-CF35-4CB4-98BD-86C01918C81C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87BA79A9-CF35-4CB4-98BD-86C01918C81C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87BA79A9-CF35-4CB4-98BD-86C01918C81C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8AB53DAE-273C-4081-BC52-E0656BEC52E5} + EndGlobalSection +EndGlobal diff --git a/FactoryContracts/BindingModels/ClientBindingModel.cs b/FactoryContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..19c73da --- /dev/null +++ b/FactoryContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,15 @@ +using FactoryDataModels.Models; + +namespace FactoryContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + + public string Login { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs b/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs new file mode 100644 index 0000000..4854049 --- /dev/null +++ b/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs @@ -0,0 +1,15 @@ +using FactoryDataModels.Models; +using FactoryDataModels.Enums; + +namespace FactoryContracts.BindingModels +{ + public class ExecutionPhaseBindingModel : IExecutionPhaseModel + { + public int Id { get; set; } + + public string ImplementerFIO { get; set; } = string.Empty; + public ExecutionPhaseStatus Status { get; set; } = ExecutionPhaseStatus.Неизвестен; + public int ClientId { get; set; } + + } +} \ No newline at end of file diff --git a/FactoryContracts/BindingModels/PlanProductionBindingModel.cs b/FactoryContracts/BindingModels/PlanProductionBindingModel.cs new file mode 100644 index 0000000..2a36ec9 --- /dev/null +++ b/FactoryContracts/BindingModels/PlanProductionBindingModel.cs @@ -0,0 +1,19 @@ +using FactoryDataModels.Models; + +namespace FactoryContracts.BindingModels +{ + public class PlanProductionBindingModel : IPlanProductionModel + { + + public int Id { get; set; } + public int ExecutionPhaseId { get; set; } + public int ClientId { get; set; } + public string ProductionName { get; set; } = string.Empty; + + public int Count { get; set; } + + public DateTime Term { get; set; } + + public Dictionary PlanProductionWorkpieces { get; set; } = new(); + } +} diff --git a/FactoryContracts/BindingModels/WorkpieceBindingModel.cs b/FactoryContracts/BindingModels/WorkpieceBindingModel.cs new file mode 100644 index 0000000..88cd4ad --- /dev/null +++ b/FactoryContracts/BindingModels/WorkpieceBindingModel.cs @@ -0,0 +1,17 @@ +using FactoryDataModels.Models; + +namespace FactoryContracts.BindingModels +{ + public class WorkpieceBindingModel : IWorkpieceModel + { + public int Id { get; set; } + public int ClientId { get; set; } + + public string WorkpieceName { get; set; } = string.Empty; + public string Material { get; set; } = string.Empty; + + public double Cost { get; set; } + + //public Dictionary WorkComponents { get; set; } = new(); + } +} \ No newline at end of file diff --git a/FactoryContracts/BusinessLogicsContracts/IClientLogic.cs b/FactoryContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..d52034e --- /dev/null +++ b/FactoryContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,19 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.BusinessLogicsContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + + ClientViewModel? ReadElement(ClientSearchModel model); + + bool Create(ClientBindingModel model); + + bool Update(ClientBindingModel model); + + bool Delete(ClientBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/BusinessLogicsContracts/IExecutionPhaseLogic.cs b/FactoryContracts/BusinessLogicsContracts/IExecutionPhaseLogic.cs new file mode 100644 index 0000000..9d0f86f --- /dev/null +++ b/FactoryContracts/BusinessLogicsContracts/IExecutionPhaseLogic.cs @@ -0,0 +1,19 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.BusinessLogicsContracts +{ + public interface IExecutionPhaseLogic + { + List? ReadList(ExecutionPhaseSearchModel? model); + + ExecutionPhaseViewModel? ReadElement(ExecutionPhaseSearchModel model); + + bool Create(ExecutionPhaseBindingModel model); + + bool Update(ExecutionPhaseBindingModel model); + + bool Delete(ExecutionPhaseBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs b/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs new file mode 100644 index 0000000..a4560d5 --- /dev/null +++ b/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs @@ -0,0 +1,20 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.BusinessLogicsContracts +{ + public interface IPlanProductionLogic + { + List? ReadList(PlanProductionSearchModel? model); + PlanProductionViewModel? ReadElement(PlanProductionSearchModel model); + + bool CreatePlanProduction(PlanProductionBindingModel model); + + bool TakePlanProductionInWork(PlanProductionBindingModel model); + + bool FinishPlanProduction(PlanProductionBindingModel model); + + bool DeliveryPlanProduction(PlanProductionBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/BusinessLogicsContracts/IWorkpieceLogic.cs b/FactoryContracts/BusinessLogicsContracts/IWorkpieceLogic.cs new file mode 100644 index 0000000..09e42f8 --- /dev/null +++ b/FactoryContracts/BusinessLogicsContracts/IWorkpieceLogic.cs @@ -0,0 +1,19 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.BusinessLogicsContracts +{ + public interface IWorkpieceLogic + { + List? ReadList(WorkpieceSearchModel? model); + + WorkpieceViewModel? ReadElement(WorkpieceSearchModel model); + + bool Create(WorkpieceBindingModel model); + + bool Update(WorkpieceBindingModel model); + + bool Delete(WorkpieceBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/FactoryContracts.csproj b/FactoryContracts/FactoryContracts.csproj new file mode 100644 index 0000000..5566994 --- /dev/null +++ b/FactoryContracts/FactoryContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/FactoryContracts/SearchModels/ClientSearchModel.cs b/FactoryContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..f130500 --- /dev/null +++ b/FactoryContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,11 @@ +namespace FactoryContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + + public string? Login { get; set; } + + public string? Password { get; set; } + } +} \ No newline at end of file diff --git a/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs b/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs new file mode 100644 index 0000000..8059991 --- /dev/null +++ b/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs @@ -0,0 +1,11 @@ +namespace FactoryContracts.SearchModels +{ + public class ExecutionPhaseSearchModel + { + public int? Id { get; set; } + + public string? ImplementerFIO { get; set; } + + public string? Password { get; set; } + } +} \ No newline at end of file diff --git a/FactoryContracts/SearchModels/PlanProductionSearchModel.cs b/FactoryContracts/SearchModels/PlanProductionSearchModel.cs new file mode 100644 index 0000000..0a852a5 --- /dev/null +++ b/FactoryContracts/SearchModels/PlanProductionSearchModel.cs @@ -0,0 +1,9 @@ +using FactoryDataModels.Enums; + +namespace FactoryContracts.SearchModels +{ + public class PlanProductionSearchModel + { + public int? Id { get; set; } + } +} \ No newline at end of file diff --git a/FactoryContracts/SearchModels/WorkpieceSearchModel.cs b/FactoryContracts/SearchModels/WorkpieceSearchModel.cs new file mode 100644 index 0000000..59ef1af --- /dev/null +++ b/FactoryContracts/SearchModels/WorkpieceSearchModel.cs @@ -0,0 +1,9 @@ +namespace FactoryContracts.SearchModels +{ + public class WorkpieceSearchModel + { + public int? Id { get; set; } + + public string? WorkName { get; set; } + } +} \ No newline at end of file diff --git a/FactoryContracts/StoragesContracts/IClientStorage.cs b/FactoryContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..5b7ed22 --- /dev/null +++ b/FactoryContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,21 @@ +using FactoryContracts.ViewModels; +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; + +namespace FactoryContracts.StoragesContracts +{ + public interface IClientStorage + { + List GetFullList(); + + List GetFilteredList(ClientSearchModel model); + + ClientViewModel? GetElement(ClientSearchModel model); + + ClientViewModel? Insert(ClientBindingModel model); + + ClientViewModel? Update(ClientBindingModel model); + + ClientViewModel? Delete(ClientBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/StoragesContracts/IExecutionPhaseStorage.cs b/FactoryContracts/StoragesContracts/IExecutionPhaseStorage.cs new file mode 100644 index 0000000..1a6e635 --- /dev/null +++ b/FactoryContracts/StoragesContracts/IExecutionPhaseStorage.cs @@ -0,0 +1,21 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.StoragesContracts +{ + public interface IExecutionPhaseStorage + { + List GetFullList(); + + List GetFilteredList(ExecutionPhaseSearchModel model); + + ExecutionPhaseViewModel? GetElement(ExecutionPhaseSearchModel model); + + ExecutionPhaseViewModel? Insert(ExecutionPhaseBindingModel model); + + ExecutionPhaseViewModel? Update(ExecutionPhaseBindingModel model); + + ExecutionPhaseViewModel? Delete(ExecutionPhaseBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs b/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs new file mode 100644 index 0000000..130ba49 --- /dev/null +++ b/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs @@ -0,0 +1,21 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.StoragesContracts +{ + public interface IPlanProductionStorage + { + List GetFullList(); + + List GetFilteredList(PlanProductionSearchModel model); + + PlanProductionViewModel? GetElement(PlanProductionSearchModel model); + + PlanProductionViewModel? Insert(ExecutionPhaseBindingModel model); + + PlanProductionViewModel? Update(ExecutionPhaseBindingModel model); + + PlanProductionViewModel? Delete(ExecutionPhaseBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/StoragesContracts/IWorkpieceStorage.cs b/FactoryContracts/StoragesContracts/IWorkpieceStorage.cs new file mode 100644 index 0000000..08f0ae5 --- /dev/null +++ b/FactoryContracts/StoragesContracts/IWorkpieceStorage.cs @@ -0,0 +1,21 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; + +namespace FactoryContracts.StoragesContracts +{ + public interface IWorkpieceStorage + { + List GetFullList(); + + List GetFilteredList(WorkpieceSearchModel model); + + WorkpieceViewModel? GetElement(WorkpieceSearchModel model); + + WorkpieceViewModel? Insert(WorkpieceBindingModel model); + + WorkpieceViewModel? Update(WorkpieceBindingModel model); + + WorkpieceViewModel? Delete(WorkpieceBindingModel model); + } +} \ No newline at end of file diff --git a/FactoryContracts/ViewModels/ClientViewModel.cs b/FactoryContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..5f7ad67 --- /dev/null +++ b/FactoryContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,19 @@ +using FactoryDataModels.Models; +using System.ComponentModel; + +namespace FactoryContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + public int Id { get; set; } + + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Электронная почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs b/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs new file mode 100644 index 0000000..9aab99f --- /dev/null +++ b/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs @@ -0,0 +1,21 @@ +using FactoryDataModels.Enums; +using FactoryDataModels.Models; +using System.ComponentModel; + +namespace FactoryContracts.ViewModels +{ + public class ExecutionPhaseViewModel : IExecutionPhaseModel + { + public int Id { get; set; } + + [DisplayName("ФИО исполнителя")] + public string ImplementerFIO { get; set; } = string.Empty; + + [DisplayName("Статус этапа")] + public ExecutionPhaseStatus Status { get; set; } = ExecutionPhaseStatus.Неизвестен; + [DisplayName("Номер клиента")] + public int ClientId { get; set; } + + + } +} \ No newline at end of file diff --git a/FactoryContracts/ViewModels/PlanProductionViewModel.cs b/FactoryContracts/ViewModels/PlanProductionViewModel.cs new file mode 100644 index 0000000..d3da10c --- /dev/null +++ b/FactoryContracts/ViewModels/PlanProductionViewModel.cs @@ -0,0 +1,26 @@ +using FactoryDataModels.Enums; +using FactoryDataModels.Models; +using System.ComponentModel; + +namespace FactoryContracts.ViewModels +{ + public class PlanProductionViewModel : IPlanProductionModel + { + [DisplayName("Номер")] + public int Id { get; set; } + [DisplayName("Номер этапа выполнения")] + public int ExecutionPhaseId { get; set; } + [DisplayName("Этап выполнения")] + public ExecutionPhaseStatus ExecutionPhase { get; set; } = ExecutionPhaseStatus.Неизвестен; + [DisplayName("Номер клиента")] + public int ClientId { get; set; } + [DisplayName("Наименование")] + public string ProductionName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count { get; set; } + [DisplayName("Срок выполнения")] + public DateTime Term { get; set; } + [DisplayName("Заготовки")] + public Dictionary PlanProductionWorkpieces { get; set; } = new(); + } +} \ No newline at end of file diff --git a/FactoryContracts/ViewModels/WorkpieceViewModel.cs b/FactoryContracts/ViewModels/WorkpieceViewModel.cs new file mode 100644 index 0000000..274d8ae --- /dev/null +++ b/FactoryContracts/ViewModels/WorkpieceViewModel.cs @@ -0,0 +1,22 @@ +using FactoryDataModels.Models; +using System.ComponentModel; + +namespace FactoryContracts.ViewModels +{ + public class WorkpieceViewModel : IWorkpieceModel + { + public int Id { get; set; } + + [DisplayName("Название заготовки")] + public string WorkpieceName { get; set; } = string.Empty; + + [DisplayName("Материал")] + public string Material { get; set; } = string.Empty; + [DisplayName("Название заготовки")] + public double Cost { get; set; } + [DisplayName("Номер клиента")] + public int ClientId { get; set; } + //[DisplayName("Изделия")] + //public Dictionary WorkpieceProducts { get; set; } = new(); + } +} diff --git a/FactoryDataModels/Enums/ExecutionPhaseStatus.cs b/FactoryDataModels/Enums/ExecutionPhaseStatus.cs new file mode 100644 index 0000000..ac10c7a --- /dev/null +++ b/FactoryDataModels/Enums/ExecutionPhaseStatus.cs @@ -0,0 +1,15 @@ +namespace FactoryDataModels.Enums +{ + public enum ExecutionPhaseStatus + { + Неизвестен = -1, + + Принят = 0, + + Выполняется = 1, + + Готов = 2, + + Выдан = 3 + } +} \ No newline at end of file diff --git a/FactoryDataModels/FactoryDataModels.csproj b/FactoryDataModels/FactoryDataModels.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/FactoryDataModels/FactoryDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/FactoryDataModels/IId.cs b/FactoryDataModels/IId.cs new file mode 100644 index 0000000..770640e --- /dev/null +++ b/FactoryDataModels/IId.cs @@ -0,0 +1,7 @@ +namespace FactoryDataModels +{ + public interface IId + { + int Id { get; } + } +} \ No newline at end of file diff --git a/FactoryDataModels/Models/IClientModel.cs b/FactoryDataModels/Models/IClientModel.cs new file mode 100644 index 0000000..7a28b1a --- /dev/null +++ b/FactoryDataModels/Models/IClientModel.cs @@ -0,0 +1,11 @@ +namespace FactoryDataModels.Models +{ + public interface IClientModel : IId + { + string Login { get; } + + string Email { get; } + + string Password { get; } + } +} diff --git a/FactoryDataModels/Models/IExecutionPhaseModel.cs b/FactoryDataModels/Models/IExecutionPhaseModel.cs new file mode 100644 index 0000000..704fb19 --- /dev/null +++ b/FactoryDataModels/Models/IExecutionPhaseModel.cs @@ -0,0 +1,12 @@ + +using FactoryDataModels.Enums; + +namespace FactoryDataModels.Models +{ + public interface IExecutionPhaseModel : IId + { + string ImplementerFIO { get; } + ExecutionPhaseStatus Status { get; } + int ClientId { get; } + } +} diff --git a/FactoryDataModels/Models/IPlanProductionModel.cs b/FactoryDataModels/Models/IPlanProductionModel.cs new file mode 100644 index 0000000..42a9776 --- /dev/null +++ b/FactoryDataModels/Models/IPlanProductionModel.cs @@ -0,0 +1,16 @@ +namespace FactoryDataModels.Models +{ + public interface IPlanProductionModel : IId + { + int ExecutionPhaseId { get; } + int ClientId { get; } + string ProductionName { get; } + + int Count { get; } + + DateTime Term { get; } + Dictionary PlanProductionWorkpieces { get; } + + + } +} \ No newline at end of file diff --git a/FactoryDataModels/Models/IWorkpieceModel.cs b/FactoryDataModels/Models/IWorkpieceModel.cs new file mode 100644 index 0000000..e2e7131 --- /dev/null +++ b/FactoryDataModels/Models/IWorkpieceModel.cs @@ -0,0 +1,15 @@ +namespace FactoryDataModels.Models +{ + public interface IWorkpieceModel : IId + { + string WorkpieceName { get; } + + string Material { get; } + + double Cost { get; } + + int ClientId { get; } + + //Dictionary WorkpieceProducts { get; } + } +} \ No newline at end of file