From a93d78d901b94849343b6942b43a2c3e599516d2 Mon Sep 17 00:00:00 2001 From: sardq Date: Sat, 20 Apr 2024 22:45:44 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=B9=20=D0=B1=D0=B8=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8,=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2?= =?UTF-8?q?=20SearchModels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Factory/Factory.sln | 10 +- .../BusinessLogics/ClientLogic.cs | 119 +++++++++++++++++ .../BusinessLogics/ExecutionPhaseLogic.cs | 120 ++++++++++++++++++ .../BusinessLogics/PlanProductionLogic.cs | 115 +++++++++++++++++ .../BusinessLogics/WorkLogic.cs | 116 +++++++++++++++++ .../FactoryBuisinessLogic.csproj | 17 +++ .../ExecutionPhaseBindingModel.cs | 1 + .../IPlanProductionLogic.cs | 8 +- .../SearchModels/ExecutionPhaseSearchModel.cs | 4 +- .../SearchModels/PlanProductionSearchModel.cs | 1 + .../SearchModels/WorkpieceSearchModel.cs | 2 +- .../IPlanProductionStorage.cs | 6 +- .../ViewModels/ExecutionPhaseViewModel.cs | 5 +- .../Models/IExecutionPhaseModel.cs | 2 + 14 files changed, 511 insertions(+), 15 deletions(-) create mode 100644 Factory/FactoryBuisinessLogic/BusinessLogics/ClientLogic.cs create mode 100644 Factory/FactoryBuisinessLogic/BusinessLogics/ExecutionPhaseLogic.cs create mode 100644 Factory/FactoryBuisinessLogic/BusinessLogics/PlanProductionLogic.cs create mode 100644 Factory/FactoryBuisinessLogic/BusinessLogics/WorkLogic.cs create mode 100644 Factory/FactoryBuisinessLogic/FactoryBuisinessLogic.csproj diff --git a/Factory/Factory.sln b/Factory/Factory.sln index f230987..700e10b 100644 --- a/Factory/Factory.sln +++ b/Factory/Factory.sln @@ -3,9 +3,11 @@ 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}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "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}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FactoryContracts", "FactoryContracts\FactoryContracts.csproj", "{87BA79A9-CF35-4CB4-98BD-86C01918C81C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactoryBuisinessLogic", "FactoryBuisinessLogic\FactoryBuisinessLogic.csproj", "{EA960B3E-6BFB-4B16-9B0A-E1D603967FEC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {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 + {EA960B3E-6BFB-4B16-9B0A-E1D603967FEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA960B3E-6BFB-4B16-9B0A-E1D603967FEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA960B3E-6BFB-4B16-9B0A-E1D603967FEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA960B3E-6BFB-4B16-9B0A-E1D603967FEC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Factory/FactoryBuisinessLogic/BusinessLogics/ClientLogic.cs b/Factory/FactoryBuisinessLogic/BusinessLogics/ClientLogic.cs new file mode 100644 index 0000000..7e4b263 --- /dev/null +++ b/Factory/FactoryBuisinessLogic/BusinessLogics/ClientLogic.cs @@ -0,0 +1,119 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.BusinessLogicsContracts; +using FactoryContracts.SearchModels; +using FactoryContracts.StoragesContracts; +using FactoryContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace FactoryBusinessLogic.BusinessLogics +{ + public class ClientLogic : IClientLogic + { + private readonly ILogger _logger; + + private readonly IClientStorage _clientStorage; + + public ClientLogic(ILogger logger, IClientStorage clientStorage) + { + _logger = logger; + _clientStorage = clientStorage; + } + + public List? ReadList(ClientSearchModel? model) + { + _logger.LogInformation("ReadList. Login:{Login}. Id:{Id}", model?.Login, model?.Id); + var list = model == null ? _clientStorage.GetFullList() : _clientStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + public ClientViewModel? ReadElement(ClientSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. Login:{Login}. Id:{Id}", model.Login, model.Id); + var element = _clientStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public bool Create(ClientBindingModel model) + { + CheckModel(model); + if (_clientStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool Update(ClientBindingModel model) + { + CheckModel(model); + if (_clientStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(ClientBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_clientStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + private void CheckModel(ClientBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.Login)) + { + throw new ArgumentNullException("Нет логина клиента", nameof(model.Login)); + } + if (string.IsNullOrEmpty(model.Email)) + { + throw new ArgumentNullException("Нет почты клиента", nameof(model.Email)); + } + if (string.IsNullOrEmpty(model.Password)) + { + throw new ArgumentNullException("Нет пароля клиента", nameof(model.Email)); + } + _logger.LogInformation("Client. Login:{Login}. Email:{Email}. Password:{Password}.", model.Login, model.Email, model.Password); + var element = _clientStorage.GetElement(new ClientSearchModel + { + Login = model.Login + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Клиент с таким логином уже есть"); + } + } + } +} \ No newline at end of file diff --git a/Factory/FactoryBuisinessLogic/BusinessLogics/ExecutionPhaseLogic.cs b/Factory/FactoryBuisinessLogic/BusinessLogics/ExecutionPhaseLogic.cs new file mode 100644 index 0000000..617b471 --- /dev/null +++ b/Factory/FactoryBuisinessLogic/BusinessLogics/ExecutionPhaseLogic.cs @@ -0,0 +1,120 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.BusinessLogicsContracts; +using FactoryContracts.SearchModels; +using FactoryContracts.StoragesContracts; +using FactoryContracts.ViewModels; +using FactoryDataModels.Enums; +using Microsoft.Extensions.Logging; + +namespace FactoryBusinessLogic.BusinessLogics +{ + public class ExecutionPhaseLogic : IExecutionPhaseLogic + { + private readonly ILogger _logger; + + private readonly IExecutionPhaseStorage _executionPhaseStorage; + + public ExecutionPhaseLogic(ILogger logger, IExecutionPhaseStorage executionPhaseStorage) + { + _logger = logger; + _executionPhaseStorage = executionPhaseStorage; + } + + public List? ReadList(ExecutionPhaseSearchModel? model) + { + _logger.LogInformation("ReadList. ExecutionPhaseName:{ExecutionPhaseName}. Id:{Id}", model?.ExecutionPhaseName, model?.Id); + var list = model == null ? _executionPhaseStorage.GetFullList() : _executionPhaseStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + public ExecutionPhaseViewModel? ReadElement(ExecutionPhaseSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. ExecutionPhaseName:{ExecutionPhaseName}. Id:{Id}", model.ExecutionPhaseName, model.Id); + var element = _executionPhaseStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public bool Create(ExecutionPhaseBindingModel model) + { + CheckModel(model); + if (_executionPhaseStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool Update(ExecutionPhaseBindingModel model) + { + CheckModel(model); + if (_executionPhaseStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(ExecutionPhaseBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_executionPhaseStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + private void CheckModel(ExecutionPhaseBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.ExecutionPhaseName)) + { + throw new ArgumentNullException("Нет названия этапа выполнения", nameof(model.ExecutionPhaseName)); + } + if (string.IsNullOrEmpty(model.ImplementerFIO)) + { + throw new ArgumentNullException("Нет ФИО исполнителя", nameof(model.ImplementerFIO)); + } + if (model.Status == ExecutionPhaseStatus.Неизвестен) + { + throw new ArgumentNullException("Состояние этапа не может быть неизвестно", nameof(model.Status)); + } + _logger.LogInformation("ExecutionPhase. ExecutionPhaseName:{ExecutionPhaseName}. ImplementerFIO:{ImplementerFIO}. Status:{Status}. Id:{Id}", model.ExecutionPhaseName, model.ImplementerFIO, model.Status, model.Id); + var element = _executionPhaseStorage.GetElement(new ExecutionPhaseSearchModel + { + ExecutionPhaseName = model.ExecutionPhaseName + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Этап с таким названием уже есть"); + } + } + } +} \ No newline at end of file diff --git a/Factory/FactoryBuisinessLogic/BusinessLogics/PlanProductionLogic.cs b/Factory/FactoryBuisinessLogic/BusinessLogics/PlanProductionLogic.cs new file mode 100644 index 0000000..eaf9866 --- /dev/null +++ b/Factory/FactoryBuisinessLogic/BusinessLogics/PlanProductionLogic.cs @@ -0,0 +1,115 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.BusinessLogicsContracts; +using FactoryContracts.SearchModels; +using FactoryContracts.ViewModels; +using FactoryContracts.StoragesContracts; +using Microsoft.Extensions.Logging; + + +namespace FactoryBusinessLogic.BusinessLogics +{ + public class PlanProductionLogic : IPlanProductionLogic + { + private readonly ILogger _logger; + + private readonly IPlanProductionStorage _planProductionStorage; + public PlanProductionLogic(ILogger logger, IPlanProductionStorage planProductionStorage) + { + _logger = logger; + _planProductionStorage = planProductionStorage; + } + + public List? ReadList(PlanProductionSearchModel? model) + { + _logger.LogInformation("ReadList. ProductionName:{ProductionName}. Id:{Id}", model?.ProductionName, model?.Id); + var list = model == null ? _planProductionStorage.GetFullList() : _planProductionStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + public PlanProductionViewModel? ReadElement(PlanProductionSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. ProductionName:{ProductionName}. Id:{Id}", model.ProductionName, model.Id); + var element = _planProductionStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public bool Create(PlanProductionBindingModel model) + { + CheckModel(model); + if (_planProductionStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool Update(PlanProductionBindingModel model) + { + CheckModel(model); + if (_planProductionStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(PlanProductionBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_planProductionStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + private void CheckModel(PlanProductionBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.ProductionName)) + { + throw new ArgumentNullException("Нет названия плана производства", nameof(model.ProductionName)); + } + if (model.Count <= 0) + { + throw new ArgumentNullException("Количество должно быть больше 0", nameof(model.Count)); + } + _logger.LogInformation("PlanProduction. ProductionName:{ProductionName}. Count:{Count}. Id:{Id}", model.ProductionName, model.Count, model.Id); + var element = _planProductionStorage.GetElement(new PlanProductionSearchModel + { + ProductionName = model.ProductionName + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("План производства с таким названием уже есть"); + } + } + } +} \ No newline at end of file diff --git a/Factory/FactoryBuisinessLogic/BusinessLogics/WorkLogic.cs b/Factory/FactoryBuisinessLogic/BusinessLogics/WorkLogic.cs new file mode 100644 index 0000000..82bbb00 --- /dev/null +++ b/Factory/FactoryBuisinessLogic/BusinessLogics/WorkLogic.cs @@ -0,0 +1,116 @@ +using FactoryContracts.BindingModels; +using FactoryContracts.BusinessLogicsContracts; +using FactoryContracts.SearchModels; +using FactoryContracts.StoragesContracts; +using FactoryContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace FactoryBusinessLogic.BusinessLogics +{ + public class WorkpieceLogic : IWorkpieceLogic + { + private readonly ILogger _logger; + + private readonly IWorkpieceStorage _workpieceStorage; + public WorkpieceLogic(ILogger logger, IWorkpieceStorage workpieceStorage) + { + _logger = logger; + _workpieceStorage = workpieceStorage; + } + public bool Create(WorkpieceBindingModel model) + { + CheckModel(model); + if (_workpieceStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + public bool Update(WorkpieceBindingModel model) + { + CheckModel(model); + if (_workpieceStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(WorkpieceBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_workpieceStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + public WorkpieceViewModel? ReadElement(WorkpieceSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. WorkpieceName:{WorkpieceName}. Id:{Id}", model.WorkpieceName, model.Id); + var element = _workpieceStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public List? ReadList(WorkpieceSearchModel? model) + { + _logger.LogInformation("ReadList. WorkpieceName:{WorkpieceName}. Id:{Id}", model?.WorkpieceName, model?.Id); + var list = model == null ? _workpieceStorage.GetFullList() : _workpieceStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + private void CheckModel(WorkpieceBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.WorkpieceName)) + { + throw new ArgumentNullException("Нет названия заготовки", nameof(model.WorkpieceName)); + } + if (string.IsNullOrEmpty(model.Material)) + { + throw new ArgumentNullException("Нет материала для заготовки", nameof(model.Material)); + } + if (model.Cost <= 0) + { + throw new ArgumentNullException("Цена заготовки должна быть больше 0", nameof(model.Cost)); + } + _logger.LogInformation("Component. WorkpieceName:{WorkpieceName}. Material:{Material}. Cost:{Cost}. Id:{Id}", model.WorkpieceName, model.Material, model.Cost, model.Id); + var element = _workpieceStorage.GetElement(new WorkpieceSearchModel + { + WorkpieceName = model.WorkpieceName + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Заготовка с таким названием уже есть"); + } + } + } +} \ No newline at end of file diff --git a/Factory/FactoryBuisinessLogic/FactoryBuisinessLogic.csproj b/Factory/FactoryBuisinessLogic/FactoryBuisinessLogic.csproj new file mode 100644 index 0000000..ad2595d --- /dev/null +++ b/Factory/FactoryBuisinessLogic/FactoryBuisinessLogic.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/Factory/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs b/Factory/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs index 4854049..abd5d2b 100644 --- a/Factory/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs +++ b/Factory/FactoryContracts/BindingModels/ExecutionPhaseBindingModel.cs @@ -7,6 +7,7 @@ namespace FactoryContracts.BindingModels { public int Id { get; set; } + public string ExecutionPhaseName { get; set; } = string.Empty; public string ImplementerFIO { get; set; } = string.Empty; public ExecutionPhaseStatus Status { get; set; } = ExecutionPhaseStatus.Неизвестен; public int ClientId { get; set; } diff --git a/Factory/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs b/Factory/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs index a4560d5..d632223 100644 --- a/Factory/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs +++ b/Factory/FactoryContracts/BusinessLogicsContracts/IPlanProductionLogic.cs @@ -9,12 +9,10 @@ namespace FactoryContracts.BusinessLogicsContracts List? ReadList(PlanProductionSearchModel? model); PlanProductionViewModel? ReadElement(PlanProductionSearchModel model); - bool CreatePlanProduction(PlanProductionBindingModel model); + bool Create(PlanProductionBindingModel model); - bool TakePlanProductionInWork(PlanProductionBindingModel model); + bool Update(PlanProductionBindingModel model); - bool FinishPlanProduction(PlanProductionBindingModel model); - - bool DeliveryPlanProduction(PlanProductionBindingModel model); + bool Delete(PlanProductionBindingModel model); } } \ No newline at end of file diff --git a/Factory/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs b/Factory/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs index 8059991..dd5ba03 100644 --- a/Factory/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs +++ b/Factory/FactoryContracts/SearchModels/ExecutionPhaseSearchModel.cs @@ -4,8 +4,6 @@ { public int? Id { get; set; } - public string? ImplementerFIO { get; set; } - - public string? Password { get; set; } + public string? ExecutionPhaseName { get; set; } } } \ No newline at end of file diff --git a/Factory/FactoryContracts/SearchModels/PlanProductionSearchModel.cs b/Factory/FactoryContracts/SearchModels/PlanProductionSearchModel.cs index 0a852a5..af4eea5 100644 --- a/Factory/FactoryContracts/SearchModels/PlanProductionSearchModel.cs +++ b/Factory/FactoryContracts/SearchModels/PlanProductionSearchModel.cs @@ -5,5 +5,6 @@ namespace FactoryContracts.SearchModels public class PlanProductionSearchModel { public int? Id { get; set; } + public string? ProductionName { get; set; } } } \ No newline at end of file diff --git a/Factory/FactoryContracts/SearchModels/WorkpieceSearchModel.cs b/Factory/FactoryContracts/SearchModels/WorkpieceSearchModel.cs index 59ef1af..4c2132e 100644 --- a/Factory/FactoryContracts/SearchModels/WorkpieceSearchModel.cs +++ b/Factory/FactoryContracts/SearchModels/WorkpieceSearchModel.cs @@ -4,6 +4,6 @@ { public int? Id { get; set; } - public string? WorkName { get; set; } + public string? WorkpieceName { get; set; } } } \ No newline at end of file diff --git a/Factory/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs b/Factory/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs index 130ba49..a5ceb9f 100644 --- a/Factory/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs +++ b/Factory/FactoryContracts/StoragesContracts/IPlanProductionStorage.cs @@ -12,10 +12,10 @@ namespace FactoryContracts.StoragesContracts PlanProductionViewModel? GetElement(PlanProductionSearchModel model); - PlanProductionViewModel? Insert(ExecutionPhaseBindingModel model); + PlanProductionViewModel? Insert(PlanProductionBindingModel model); - PlanProductionViewModel? Update(ExecutionPhaseBindingModel model); + PlanProductionViewModel? Update(PlanProductionBindingModel model); - PlanProductionViewModel? Delete(ExecutionPhaseBindingModel model); + PlanProductionViewModel? Delete(PlanProductionBindingModel model); } } \ No newline at end of file diff --git a/Factory/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs b/Factory/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs index 9aab99f..a3c5be2 100644 --- a/Factory/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs +++ b/Factory/FactoryContracts/ViewModels/ExecutionPhaseViewModel.cs @@ -10,9 +10,12 @@ namespace FactoryContracts.ViewModels [DisplayName("ФИО исполнителя")] public string ImplementerFIO { get; set; } = string.Empty; + [DisplayName("Описание этапа")] + public string ExecutionPhaseName { get; set; } = string.Empty; - [DisplayName("Статус этапа")] + [DisplayName("Статус")] public ExecutionPhaseStatus Status { get; set; } = ExecutionPhaseStatus.Неизвестен; + [DisplayName("Номер клиента")] public int ClientId { get; set; } diff --git a/Factory/FactoryDataModels/Models/IExecutionPhaseModel.cs b/Factory/FactoryDataModels/Models/IExecutionPhaseModel.cs index 704fb19..8d6c472 100644 --- a/Factory/FactoryDataModels/Models/IExecutionPhaseModel.cs +++ b/Factory/FactoryDataModels/Models/IExecutionPhaseModel.cs @@ -5,6 +5,8 @@ namespace FactoryDataModels.Models { public interface IExecutionPhaseModel : IId { + + string ExecutionPhaseName { get; } string ImplementerFIO { get; } ExecutionPhaseStatus Status { get; } int ClientId { get; }