From 2cefd910250f87f31860184a83594e92ce7157b3 Mon Sep 17 00:00:00 2001 From: platoff aeeee Date: Fri, 24 May 2024 13:05:47 +0400 Subject: [PATCH] 12 --- .../BussinessLogic/AdLogic.cs | 36 +++++++++---------- .../{WorkPieceLogic.cs => KommentLogic.cs} | 20 +++++------ .../{FurnitureLogic.cs => UsersLogic.cs} | 34 +++++++++--------- ...OrderBindingModel.cs => AdBindingModel.cs} | 4 +-- ...BindingModel.cs => KommentBindingModel.cs} | 2 +- ...reBindingModel.cs => UsersBindingModel.cs} | 6 ++-- .../{IOrderLogic.cs => IAdLogic.cs} | 12 +++---- .../{IWorkPieceLogic.cs => IKommentLogic.cs} | 12 +++---- .../{IFurnitureLogic.cs => IUsersLogic.cs} | 12 +++---- .../{OrderSearchModel.cs => AdSearchModel.cs} | 2 +- ...ceSearchModel.cs => KommentSearchModel.cs} | 2 +- ...tureSearchModel.cs => UsersSearchModel.cs} | 4 +-- .../StoragesContracts/IAdStorage.cs | 26 ++++++++++++++ .../StoragesContracts/IKommentStorage.cs | 27 ++++++++++++++ .../StoragesContracts/IOrderStorage.cs | 26 -------------- ...{IFurnitureStorage.cs => IUsersStorage.cs} | 12 +++---- .../StoragesContracts/IWorkPieceStorage.cs | 27 -------------- .../{OrderViewModel.cs => AdViewModel.cs} | 6 ++-- ...kPieceViewModel.cs => KommentViewModel.cs} | 2 +- ...urnitureViewModel.cs => UsersViewModel.cs} | 6 ++-- .../Enums/{OrderStatus.cs => AdStatus.cs} | 2 +- .../Models/{IOrderModel.cs => IAdModel.cs} | 4 +-- .../{IWorkPieceModel.cs => IKommentModel.cs} | 2 +- .../{IFurnitureModel.cs => IUsersModel.cs} | 6 ++-- .../FurnitureAssemblyDatabase.cs | 8 ++--- .../{OrderStorage.cs => AdStorage.cs} | 16 ++++----- ...{WorkPieceStorage.cs => KommentStorage.cs} | 16 ++++----- .../{FurnitureStorage.cs => UsersStorage.cs} | 22 ++++++------ .../20240327064137_InitialCreate.Designer.cs | 2 +- .../20240327064137_InitialCreate.cs | 2 +- .../FurnitureAssemblyDatabaseModelSnapshot.cs | 2 +- .../Models/{Order.cs => Ad.cs} | 16 ++++----- .../Models/{WorkPiece.cs => Komment.cs} | 16 ++++----- .../Models/{Furniture.cs => Users.cs} | 34 +++++++++--------- ...{FurnitureWorkPiece.cs => UsersKomment.cs} | 6 ++-- .../DataFileSingleton.cs | 12 +++---- .../{OrderStorage.cs => AdStorage.cs} | 22 ++++++------ ...{WorkPieceStorage.cs => KommentStorage.cs} | 18 +++++----- .../{FurnitureStorage.cs => UsersStorage.cs} | 24 ++++++------- .../Models/{Order.cs => Ad.cs} | 18 +++++----- .../Models/{WorkPiece.cs => Komment.cs} | 14 ++++---- .../Models/{Furniture.cs => Users.cs} | 30 ++++++++-------- .../DataListSingleton.cs | 12 +++---- .../{OrderStorage.cs => AdStorage.cs} | 26 +++++++------- ...{WorkPieceStorage.cs => KommentStorage.cs} | 22 ++++++------ .../{FurnitureStorage.cs => UsersStorage.cs} | 24 ++++++------- .../Models/{Order.cs => Ad.cs} | 12 +++---- .../Models/{WorkPiece.cs => Komment.cs} | 10 +++--- .../Models/{Furniture.cs => Users.cs} | 18 +++++----- .../FurnitureAssemblyView/FormCreateOrder.cs | 12 +++---- .../FurnitureAssemblyView/FormFurniture.cs | 18 +++++----- .../FormFurnitureWorkPiece.cs | 6 ++-- .../FurnitureAssemblyView/FormFurnitures.cs | 8 ++--- .../FormMain.Designer.cs | 30 ++++++++-------- .../FurnitureAssemblyView/FormMain.cs | 10 +++--- .../FurnitureAssemblyView/FormWorkPiece.cs | 8 ++--- .../FurnitureAssemblyView/FormWorkPieces.cs | 6 ++-- .../FurnitureAssemblyView/Program.cs | 12 +++---- 58 files changed, 402 insertions(+), 402 deletions(-) rename FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/{WorkPieceLogic.cs => KommentLogic.cs} (87%) rename FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/{FurnitureLogic.cs => UsersLogic.cs} (76%) rename FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/{OrderBindingModel.cs => AdBindingModel.cs} (82%) rename FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/{WorkPieceBindingModel.cs => KommentBindingModel.cs} (91%) rename FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/{FurnitureBindingModel.cs => UsersBindingModel.cs} (62%) rename FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/{IOrderLogic.cs => IAdLogic.cs} (55%) rename FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/{IWorkPieceLogic.cs => IKommentLogic.cs} (55%) rename FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/{IFurnitureLogic.cs => IUsersLogic.cs} (55%) rename FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/{OrderSearchModel.cs => AdSearchModel.cs} (91%) rename FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/{WorkPieceSearchModel.cs => KommentSearchModel.cs} (92%) rename FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/{FurnitureSearchModel.cs => UsersSearchModel.cs} (83%) create mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IAdStorage.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IKommentStorage.cs delete mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IOrderStorage.cs rename FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/{IFurnitureStorage.cs => IUsersStorage.cs} (54%) delete mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IWorkPieceStorage.cs rename FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/{OrderViewModel.cs => AdViewModel.cs} (83%) rename FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/{WorkPieceViewModel.cs => KommentViewModel.cs} (91%) rename FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/{FurnitureViewModel.cs => UsersViewModel.cs} (71%) rename FurnitureAssembly/FurnitureAssemblyDataModels/Enums/{OrderStatus.cs => AdStatus.cs} (92%) rename FurnitureAssembly/FurnitureAssemblyDataModels/Models/{IOrderModel.cs => IAdModel.cs} (91%) rename FurnitureAssembly/FurnitureAssemblyDataModels/Models/{IWorkPieceModel.cs => IKommentModel.cs} (91%) rename FurnitureAssembly/FurnitureAssemblyDataModels/Models/{IFurnitureModel.cs => IUsersModel.cs} (74%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/{OrderStorage.cs => AdStorage.cs} (84%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/{WorkPieceStorage.cs => KommentStorage.cs} (82%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/{FurnitureStorage.cs => UsersStorage.cs} (80%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/{Order.cs => Ad.cs} (79%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/{WorkPiece.cs => Komment.cs} (75%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/{Furniture.cs => Users.cs} (73%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/{FurnitureWorkPiece.cs => UsersKomment.cs} (73%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/{OrderStorage.cs => AdStorage.cs} (77%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/{WorkPieceStorage.cs => KommentStorage.cs} (80%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/{FurnitureStorage.cs => UsersStorage.cs} (69%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Models/{Order.cs => Ad.cs} (84%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Models/{WorkPiece.cs => Komment.cs} (82%) rename FurnitureAssembly/FurnitureAssemblyFileImplement/Models/{Furniture.cs => Users.cs} (75%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Implements/{OrderStorage.cs => AdStorage.cs} (79%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Implements/{WorkPieceStorage.cs => KommentStorage.cs} (84%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Implements/{FurnitureStorage.cs => UsersStorage.cs} (80%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Models/{Order.cs => Ad.cs} (87%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Models/{WorkPiece.cs => Komment.cs} (86%) rename FurnitureAssembly/FurnitureAssemblyListImplement/Models/{Furniture.cs => Users.cs} (74%) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/AdLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/AdLogic.cs index c76826a..678031b 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/AdLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/AdLogic.cs @@ -13,18 +13,18 @@ using System.Threading.Tasks; namespace FurnitureAssemblyBusinessLogic.BussinessLogic { - public class AdLogic : IOrderLogic + public class AdLogic : IAdLogic { - private readonly IOrderStorage _orderStorage; + private readonly IAdStorage _orderStorage; private readonly ILogger _logger; - public AdLogic(ILogger logger, IOrderStorage orderStorage) + public AdLogic(ILogger logger, IAdStorage orderStorage) { _logger = logger; _orderStorage = orderStorage; } - public List? ReadList(OrderSearchModel? model) + public List? ReadList(AdSearchModel? model) { _logger.LogInformation("ReadList. Id:{Id}", model?.Id); var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model); @@ -40,21 +40,21 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic return list; } - public bool CreateOrder(OrderBindingModel model) + public bool CreateOrder(AdBindingModel model) { CheckModel(model); - if(model.Status != OrderStatus.Неизвестен) + if(model.Status != AdStatus.Неизвестен) { _logger.LogWarning("Insert operation failed, incorrect order status"); return false; } - model.Status = OrderStatus.Принят; + model.Status = AdStatus.Принят; if(_orderStorage.Insert(model) == null) { - model.Status = OrderStatus.Неизвестен; + model.Status = AdStatus.Неизвестен; _logger.LogWarning("Insert operation failed"); return false; } @@ -62,21 +62,21 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic return true; } - public bool TakeOrderInWork(OrderBindingModel model) + public bool TakeOrderInWork(AdBindingModel model) { - return StatusUpdate(model, OrderStatus.Выполняется); + return StatusUpdate(model, AdStatus.Выполняется); } - public bool FinishOrder(OrderBindingModel model) + public bool FinishOrder(AdBindingModel model) { - return StatusUpdate(model, OrderStatus.Готов); + return StatusUpdate(model, AdStatus.Готов); } - public bool DeliveryOrder(OrderBindingModel model) + public bool DeliveryOrder(AdBindingModel model) { - return StatusUpdate(model, OrderStatus.Выдан); + return StatusUpdate(model, AdStatus.Выдан); } - private void CheckModel(OrderBindingModel model, bool withParams = true) + private void CheckModel(AdBindingModel model, bool withParams = true) { if (model == null) { @@ -114,9 +114,9 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic _logger.LogInformation("Order. OrderId:{Id}, Sum:{Sum}. FurnitureId:{Id}", model.Id, model.Sum, model.FurnitureId); } - public bool StatusUpdate(OrderBindingModel model, OrderStatus newOrderStatus) + public bool StatusUpdate(AdBindingModel model, AdStatus newOrderStatus) { - var viewModel = _orderStorage.GetElement(new OrderSearchModel { Id = model.Id }); + var viewModel = _orderStorage.GetElement(new AdSearchModel { Id = model.Id }); if(viewModel == null) { @@ -131,7 +131,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic model.Status = newOrderStatus; - if(model.Status == OrderStatus.Выдан) + if(model.Status == AdStatus.Выдан) { model.DateImplement = DateTime.Now; } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/WorkPieceLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/KommentLogic.cs similarity index 87% rename from FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/WorkPieceLogic.cs rename to FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/KommentLogic.cs index 8bcc232..a90f73c 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/WorkPieceLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/KommentLogic.cs @@ -13,21 +13,21 @@ using System.Threading.Tasks; namespace FurnitureAssemblyBusinessLogic.BussinessLogic { // Класс, реализующий логику для заготовок - public class WorkPieceLogic : IWorkPieceLogic + public class KommentLogic : IKommentLogic { private readonly ILogger _logger; - private readonly IWorkPieceStorage _workPieceStorage; + private readonly IKommentStorage _workPieceStorage; // Конструктор - public WorkPieceLogic(ILogger logger, IWorkPieceStorage workPieceStorage) + public KommentLogic(ILogger logger, IKommentStorage workPieceStorage) { _logger = logger; _workPieceStorage = workPieceStorage; } // Вывод отфильтрованного списка компонентов - public List? ReadList(WorkPieceSearchModel? model) + public List? ReadList(KommentSearchModel? model) { _logger.LogInformation("ReadList. WorkPieceName:{WorkPieceName}. Id:{Id}", model?.WorkPieceName, model?.Id); @@ -46,7 +46,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Вывод конкретной заготовки - public WorkPieceViewModel? ReadElement(WorkPieceSearchModel model) + public KommentViewModel? ReadElement(KommentSearchModel model) { if(model == null) { @@ -70,7 +70,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Создание заготовки - public bool Create(WorkPieceBindingModel model) + public bool Create(KommentBindingModel model) { CheckModel(model); @@ -85,7 +85,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Обновление заготовки - public bool Update(WorkPieceBindingModel model) + public bool Update(KommentBindingModel model) { CheckModel(model); @@ -100,7 +100,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Удаление заготовки - public bool Delete(WorkPieceBindingModel model) + public bool Delete(KommentBindingModel model) { CheckModel(model, false); @@ -117,7 +117,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Проверка входного аргумента для методов Insert, Update и Delete - private void CheckModel(WorkPieceBindingModel model, bool withParams = true) + private void CheckModel(KommentBindingModel model, bool withParams = true) { if(model == null) { @@ -146,7 +146,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic model.WorkPieceName, model.Cost, model.Id); // Проверка на наличие такой же заготовки в списке - var element = _workPieceStorage.GetElement(new WorkPieceSearchModel + var element = _workPieceStorage.GetElement(new KommentSearchModel { WorkPieceName = model.WorkPieceName, }); diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/FurnitureLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/UsersLogic.cs similarity index 76% rename from FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/FurnitureLogic.cs rename to FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/UsersLogic.cs index 967549a..cc164b0 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/FurnitureLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BussinessLogic/UsersLogic.cs @@ -13,23 +13,23 @@ using System.Threading.Tasks; namespace FurnitureAssemblyBusinessLogic.BussinessLogic { // Класс, реализующий логику для изделий - public class FurnitureLogic : IFurnitureLogic + public class UsersLogic : IUsersLogic { private readonly ILogger _logger; - private readonly IFurnitureStorage _furnitureStorage; + private readonly IUsersStorage _furnitureStorage; // Конструктор - public FurnitureLogic(ILogger logger, IFurnitureStorage furnitureStorage) + public UsersLogic(ILogger logger, IUsersStorage furnitureStorage) { _logger = logger; _furnitureStorage = furnitureStorage; } // Вывод отфильтрованного списка - public List? ReadList(FurnitureSearchModel? model) + public List? ReadList(UsersSearchModel? model) { - _logger.LogInformation("ReadList. FurnitureName: {FurnitureName}. Id:{Id}", model?.FurnitureName, model?.Id); + _logger.LogInformation("ReadList. UsersName: {UsersName}. Id:{Id}", model?.UsersName, model?.Id); // list хранит весь список в случае, если model пришло со значением null на вход метода var list = model == null ? _furnitureStorage.GetFullList() : _furnitureStorage.GetFilteredList(model); @@ -47,14 +47,14 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Вывод конкретного изделия - public FurnitureViewModel? ReadElement(FurnitureSearchModel model) + public FurnitureViewModel? ReadElement(UsersSearchModel model) { if(model == null) { throw new ArgumentNullException(nameof(model)); } - _logger.LogInformation("ReadElement. FurnitureName: {FurnitureName}. Id:{Id}", model.FurnitureName, model.Id); + _logger.LogInformation("ReadElement. UsersName: {UsersName}. Id:{Id}", model.UsersName, model.Id); var element = _furnitureStorage.GetElement(model); @@ -71,7 +71,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Создание изделия - public bool Create(FurnitureBindingModel model) + public bool Create(UsersBindingModel model) { CheckModel(model); @@ -86,7 +86,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Обновление изделия - public bool Update(FurnitureBindingModel model) + public bool Update(UsersBindingModel model) { CheckModel(model); @@ -100,7 +100,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Удаление изделия - public bool Delete(FurnitureBindingModel model) + public bool Delete(UsersBindingModel model) { CheckModel(model, false); @@ -117,7 +117,7 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Проверка входного аргумента для методов Insert, Update и Delete - private void CheckModel(FurnitureBindingModel model, bool withParams = true) + private void CheckModel(UsersBindingModel model, bool withParams = true) { if(model == null) { @@ -131,9 +131,9 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic } // Проверка на наличие названия изделия - if(string.IsNullOrEmpty(model.FurnitureName)) + if(string.IsNullOrEmpty(model.UsersName)) { - throw new ArgumentNullException("Нет названия изделия", nameof(model.FurnitureName)); + throw new ArgumentNullException("Нет названия изделия", nameof(model.UsersName)); } // Проверка на наличие нормальной цены у изделия @@ -142,13 +142,13 @@ namespace FurnitureAssemblyBusinessLogic.BussinessLogic throw new ArgumentNullException("Цена изделия должна быть больше 0", nameof(model.Price)); } - _logger.LogInformation("Furniture. FurnitureName:{FurnitureName}. Price:{Price}. Id:{Id}", - model.FurnitureName, model.Price, model.Id); + _logger.LogInformation("Furniture. UsersName:{UsersName}. Price:{Price}. Id:{Id}", + model.UsersName, model.Price, model.Id); // Проверка на наличие такого же изделия в списке - var element = _furnitureStorage.GetElement(new FurnitureSearchModel + var element = _furnitureStorage.GetElement(new UsersSearchModel { - FurnitureName = model.FurnitureName, + UsersName = model.UsersName, }); // Если элемент найден и его Id не совпадает с Id объекта, переданного на вход diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/AdBindingModel.cs similarity index 82% rename from FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/AdBindingModel.cs index da1c055..7ff91b9 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/OrderBindingModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/AdBindingModel.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BindingModels { // Реализация сущности "Заказ" - public class OrderBindingModel + public class AdBindingModel { public int Id { get; set; } @@ -18,7 +18,7 @@ namespace FurnitureAssemblyContracts.BindingModels public double Sum { get; set; } - public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + public AdStatus Status { get; set; } = AdStatus.Неизвестен; public DateTime DateCreate { get; set; } = DateTime.Now; diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/WorkPieceBindingModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/KommentBindingModel.cs similarity index 91% rename from FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/WorkPieceBindingModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/KommentBindingModel.cs index ac6fd32..557d3b2 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/WorkPieceBindingModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/KommentBindingModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BindingModels { // Реализация сущности "Компонент" - public class WorkPieceBindingModel + public class KommentBindingModel { public int Id { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/FurnitureBindingModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/UsersBindingModel.cs similarity index 62% rename from FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/FurnitureBindingModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/UsersBindingModel.cs index 1f55ebc..0063c7f 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/FurnitureBindingModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/UsersBindingModel.cs @@ -8,14 +8,14 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BindingModels { // Реализация сущности "Изделие" - public class FurnitureBindingModel : IFurnitureModel + public class UsersBindingModel : IUsersModel { public int Id { get; set; } - public string FurnitureName { get; set; } = string.Empty; + public string UsersName { get; set; } = string.Empty; public double Price { get; set; } - public Dictionary FurnitureWorkPieces { get; set; } = new(); + public Dictionary FurnitureWorkPieces { get; set; } = new(); } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IOrderLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IAdLogic.cs similarity index 55% rename from FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IOrderLogic.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IAdLogic.cs index af2d139..6c121c9 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IOrderLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IAdLogic.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BusinessLogicsContracts { // Бизнес-логика заказов - public interface IOrderLogic + public interface IAdLogic { - List? ReadList(OrderSearchModel? model); + List? ReadList(AdSearchModel? model); - bool CreateOrder(OrderBindingModel model); + bool CreateOrder(AdBindingModel model); - bool TakeOrderInWork(OrderBindingModel model); + bool TakeOrderInWork(AdBindingModel model); - bool FinishOrder(OrderBindingModel model); + bool FinishOrder(AdBindingModel model); - bool DeliveryOrder(OrderBindingModel model); + bool DeliveryOrder(AdBindingModel model); } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IWorkPieceLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IKommentLogic.cs similarity index 55% rename from FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IWorkPieceLogic.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IKommentLogic.cs index 99abee3..0226d7b 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IWorkPieceLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IKommentLogic.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BusinessLogicsContracts { // Бизнес-логика для компонентов - public interface IWorkPieceLogic + public interface IKommentLogic { - List? ReadList(WorkPieceSearchModel? model); + List? ReadList(KommentSearchModel? model); - WorkPieceViewModel? ReadElement(WorkPieceSearchModel model); + KommentViewModel? ReadElement(KommentSearchModel model); - bool Create(WorkPieceBindingModel model); + bool Create(KommentBindingModel model); - bool Update(WorkPieceBindingModel model); + bool Update(KommentBindingModel model); - bool Delete(WorkPieceBindingModel model); + bool Delete(KommentBindingModel model); } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IFurnitureLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IUsersLogic.cs similarity index 55% rename from FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IFurnitureLogic.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IUsersLogic.cs index 899db8c..4a9d2cc 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IFurnitureLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContracts/IUsersLogic.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.BusinessLogicsContracts { // Бизнес-логика для продуктов - public interface IFurnitureLogic + public interface IUsersLogic { - List? ReadList(FurnitureSearchModel? model); + List? ReadList(UsersSearchModel? model); - FurnitureViewModel? ReadElement(FurnitureSearchModel model); + FurnitureViewModel? ReadElement(UsersSearchModel model); - bool Create(FurnitureBindingModel model); + bool Create(UsersBindingModel model); - bool Update(FurnitureBindingModel model); + bool Update(UsersBindingModel model); - bool Delete(FurnitureBindingModel model); + bool Delete(UsersBindingModel model); } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/AdSearchModel.cs similarity index 91% rename from FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/AdSearchModel.cs index c0a8f4e..8a6226d 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/OrderSearchModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/AdSearchModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.SearchModels { // Для поиска сущности "Заказ" - public class OrderSearchModel + public class AdSearchModel { // для поиска по идентификатору public int? Id { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/WorkPieceSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/KommentSearchModel.cs similarity index 92% rename from FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/WorkPieceSearchModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/KommentSearchModel.cs index d89a637..bf876f0 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/WorkPieceSearchModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/KommentSearchModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.SearchModels { // Модель для поиска сущности "Компонент" (она же заготовка) - public class WorkPieceSearchModel + public class KommentSearchModel { //для поиска по идентификатору public int? Id { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/FurnitureSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/UsersSearchModel.cs similarity index 83% rename from FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/FurnitureSearchModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/UsersSearchModel.cs index 84ed187..3e47f16 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/FurnitureSearchModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/UsersSearchModel.cs @@ -7,12 +7,12 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.SearchModels { // Модель для поиска заготовки "Продукт" (она же изделие) - public class FurnitureSearchModel + public class UsersSearchModel { // для поиска по идентификатору public int? Id { get; set; } // для поиска по названию - public string? FurnitureName { get; set; } + public string? UsersName { get; set; } } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IAdStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IAdStorage.cs new file mode 100644 index 0000000..aad56fe --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IAdStorage.cs @@ -0,0 +1,26 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.SearchModels; +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyContracts.StoragesContracts +{ + public interface IAdStorage + { + List GetFullList(); + + List GetFilteredList(AdSearchModel model); + + AdViewModel? GetElement(AdSearchModel model); + + AdViewModel? Insert(AdBindingModel model); + + AdViewModel? Update(AdBindingModel model); + + AdViewModel? Delete(AdBindingModel model); + } +} \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IKommentStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IKommentStorage.cs new file mode 100644 index 0000000..f435d78 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IKommentStorage.cs @@ -0,0 +1,27 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.SearchModels; +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyContracts.StoragesContracts +{ + // Класс хранилища компонентов (заготовок) + public interface IKommentStorage + { + List GetFullList(); + + List GetFilteredList(KommentSearchModel model); + + KommentViewModel? GetElement(KommentSearchModel model); + + KommentViewModel? Insert(KommentBindingModel model); + + KommentViewModel? Update(KommentBindingModel model); + + KommentViewModel? Delete(KommentBindingModel model); + } +} \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IOrderStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IOrderStorage.cs deleted file mode 100644 index 987004f..0000000 --- a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IOrderStorage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using FurnitureAssemblyContracts.BindingModels; -using FurnitureAssemblyContracts.SearchModels; -using FurnitureAssemblyContracts.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FurnitureAssemblyContracts.StoragesContracts -{ - public interface IOrderStorage - { - List GetFullList(); - - List GetFilteredList(OrderSearchModel model); - - OrderViewModel? GetElement(OrderSearchModel model); - - OrderViewModel? Insert(OrderBindingModel model); - - OrderViewModel? Update(OrderBindingModel model); - - OrderViewModel? Delete(OrderBindingModel model); - } -} \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IFurnitureStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IUsersStorage.cs similarity index 54% rename from FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IFurnitureStorage.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IUsersStorage.cs index fbb0394..a76c07d 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IFurnitureStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IUsersStorage.cs @@ -10,18 +10,18 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.StoragesContracts { // Класс для хранилища продуктов (изделий) - public interface IFurnitureStorage + public interface IUsersStorage { List GetFullList(); - List GetFilteredList(FurnitureSearchModel model); + List GetFilteredList(UsersSearchModel model); - FurnitureViewModel? GetElement(FurnitureSearchModel model); + FurnitureViewModel? GetElement(UsersSearchModel model); - FurnitureViewModel? Insert(FurnitureBindingModel model); + FurnitureViewModel? Insert(UsersBindingModel model); - FurnitureViewModel? Update(FurnitureBindingModel model); + FurnitureViewModel? Update(UsersBindingModel model); - FurnitureViewModel? Delete(FurnitureBindingModel model); + FurnitureViewModel? Delete(UsersBindingModel model); } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IWorkPieceStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IWorkPieceStorage.cs deleted file mode 100644 index ef57983..0000000 --- a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IWorkPieceStorage.cs +++ /dev/null @@ -1,27 +0,0 @@ -using FurnitureAssemblyContracts.BindingModels; -using FurnitureAssemblyContracts.SearchModels; -using FurnitureAssemblyContracts.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FurnitureAssemblyContracts.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/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/AdViewModel.cs similarity index 83% rename from FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/AdViewModel.cs index b2b7ea1..2d9e6da 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/OrderViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/AdViewModel.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.ViewModels { // Класс для отображения пользователю информации о заказах - public class OrderViewModel : IOrderModel + public class AdViewModel : IAdModel { [DisplayName("Номер")] public int Id { get; set; } @@ -18,7 +18,7 @@ namespace FurnitureAssemblyContracts.ViewModels public int FurnitureId { get; set; } [DisplayName("Изделие")] - public string FurnitureName { get; set; } = string.Empty; + public string UsersName { get; set; } = string.Empty; [DisplayName("Количество")] public int Count { get; set; } @@ -27,7 +27,7 @@ namespace FurnitureAssemblyContracts.ViewModels public double Sum { get; set; } [DisplayName("Статус")] - public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + public AdStatus Status { get; set; } = AdStatus.Неизвестен; [DisplayName("Дата создания")] public DateTime DateCreate { get; set; } = DateTime.Now; diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/WorkPieceViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/KommentViewModel.cs similarity index 91% rename from FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/WorkPieceViewModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/KommentViewModel.cs index 8eb29ab..a49b2b7 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/WorkPieceViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/KommentViewModel.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.ViewModels { // Класс для отображения пользователю данных о заготовке (заготовках) - public class WorkPieceViewModel : IWorkPieceModel + public class KommentViewModel : IKommentModel { public int Id { get; set; } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/FurnitureViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/UsersViewModel.cs similarity index 71% rename from FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/FurnitureViewModel.cs rename to FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/UsersViewModel.cs index f24f746..16e5991 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/FurnitureViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/UsersViewModel.cs @@ -9,16 +9,16 @@ using System.Threading.Tasks; namespace FurnitureAssemblyContracts.ViewModels { // Класс для отображения пользователю информации о продуктах (изделиях) - public class FurnitureViewModel : IFurnitureModel + public class FurnitureViewModel : IUsersModel { public int Id { get; set; } [DisplayName("Название изделия")] - public string FurnitureName { get; set; } = string.Empty; + public string UsersName { get; set; } = string.Empty; [DisplayName("Цена")] public double Price { get; set; } - public Dictionary FurnitureWorkPieces { get; set; } = new(); + public Dictionary FurnitureWorkPieces { get; set; } = new(); } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyDataModels/Enums/OrderStatus.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Enums/AdStatus.cs similarity index 92% rename from FurnitureAssembly/FurnitureAssemblyDataModels/Enums/OrderStatus.cs rename to FurnitureAssembly/FurnitureAssemblyDataModels/Enums/AdStatus.cs index 925282e..3ea8671 100644 --- a/FurnitureAssembly/FurnitureAssemblyDataModels/Enums/OrderStatus.cs +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Enums/AdStatus.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDataModels.Enums { // Статус заказа - public enum OrderStatus + public enum AdStatus { Неизвестен = -1, diff --git a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IOrderModel.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IAdModel.cs similarity index 91% rename from FurnitureAssembly/FurnitureAssemblyDataModels/Models/IOrderModel.cs rename to FurnitureAssembly/FurnitureAssemblyDataModels/Models/IAdModel.cs index 0616975..5bcfa02 100644 --- a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IOrderModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IAdModel.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDataModels.Models { // Интерфейс, отвечающий за заказ - public interface IOrderModel : IId + public interface IAdModel : IId { // id продукта int FurnitureId { get; } @@ -20,7 +20,7 @@ namespace FurnitureAssemblyDataModels.Models double Sum { get; } // статус заказа - OrderStatus Status { get; } + AdStatus Status { get; } //дата создания заказа DateTime DateCreate { get; } diff --git a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IWorkPieceModel.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IKommentModel.cs similarity index 91% rename from FurnitureAssembly/FurnitureAssemblyDataModels/Models/IWorkPieceModel.cs rename to FurnitureAssembly/FurnitureAssemblyDataModels/Models/IKommentModel.cs index 251dd41..241bf11 100644 --- a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IWorkPieceModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IKommentModel.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDataModels.Models { // Интерфейс, отвечающий за компоненты - public interface IWorkPieceModel : IId + public interface IKommentModel : IId { // название составляющей (изделие состоит из составляющих) string WorkPieceName { get; } diff --git a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IFurnitureModel.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IUsersModel.cs similarity index 74% rename from FurnitureAssembly/FurnitureAssemblyDataModels/Models/IFurnitureModel.cs rename to FurnitureAssembly/FurnitureAssemblyDataModels/Models/IUsersModel.cs index 0eb9d4d..6585ed7 100644 --- a/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IFurnitureModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IUsersModel.cs @@ -7,15 +7,15 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDataModels.Models { // Интерфейс, отвечающий за продукт - public interface IFurnitureModel : IId + public interface IUsersModel : IId { // наименование изделия - string FurnitureName { get; } + string UsersName { get; } // цена изделия double Price { get; } // словарь, хранящий пары кол-во + компонент и его цена - Dictionary FurnitureWorkPieces { get; } + Dictionary FurnitureWorkPieces { get; } } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs index 5f939e3..cf331e9 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabase.cs @@ -20,12 +20,12 @@ namespace FurnitureAssemblyDatabaseImplement base.OnConfiguring(optionsBuilder); } - public virtual DbSet WorkPieces { set; get; } + public virtual DbSet WorkPieces { set; get; } - public virtual DbSet Furnitures { set; get; } + public virtual DbSet Furnitures { set; get; } - public virtual DbSet FurnitureWorkPieces { set; get; } + public virtual DbSet FurnitureWorkPieces { set; get; } - public virtual DbSet Orders { set; get; } + public virtual DbSet Orders { set; get; } } } diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/OrderStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/AdStorage.cs similarity index 84% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/OrderStorage.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/AdStorage.cs index 91d2c94..d6ab77c 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/OrderStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/AdStorage.cs @@ -12,9 +12,9 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Implements { - public class OrderStorage : IOrderStorage + public class AdStorage : IAdStorage { - public OrderViewModel? GetElement(OrderSearchModel model) + public AdViewModel? GetElement(AdSearchModel model) { if (!model.Id.HasValue) { @@ -28,7 +28,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements ?.GetViewModel; } - public List GetFilteredList(OrderSearchModel model) + public List GetFilteredList(AdSearchModel model) { if (!model.Id.HasValue) { @@ -44,7 +44,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .ToList(); } - public List GetFullList() + public List GetFullList() { using var context = new FurnitureAssemblyDatabase(); @@ -52,9 +52,9 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .Select(x => x.GetViewModel).ToList(); } - public OrderViewModel? Insert(OrderBindingModel model) + public AdViewModel? Insert(AdBindingModel model) { - var newOrder = Order.Create(model); + var newOrder = Ad.Create(model); if (newOrder == null) { @@ -69,7 +69,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel; } - public OrderViewModel? Update(OrderBindingModel model) + public AdViewModel? Update(AdBindingModel model) { using var context = new FurnitureAssemblyDatabase(); var order = context.Orders.FirstOrDefault(x => x.Id == model.Id); @@ -85,7 +85,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return context.Orders.Include(x => x.Furniture).FirstOrDefault(x => x.Id == model.Id)?.GetViewModel; } - public OrderViewModel? Delete(OrderBindingModel model) + public AdViewModel? Delete(AdBindingModel model) { using var context = new FurnitureAssemblyDatabase(); var element = context.Orders.FirstOrDefault(rec => rec.Id == model.Id); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/WorkPieceStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/KommentStorage.cs similarity index 82% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/WorkPieceStorage.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/KommentStorage.cs index d0faa55..151852c 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/WorkPieceStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/KommentStorage.cs @@ -11,9 +11,9 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Implements { - public class WorkPieceStorage : IWorkPieceStorage + public class KommentStorage : IKommentStorage { - public List GetFullList() + public List GetFullList() { using var context = new FurnitureAssemblyDatabase(); @@ -22,7 +22,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .ToList(); } - public List GetFilteredList(WorkPieceSearchModel model) + public List GetFilteredList(KommentSearchModel model) { if (string.IsNullOrEmpty(model.WorkPieceName)) { @@ -37,7 +37,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .ToList(); } - public WorkPieceViewModel? GetElement(WorkPieceSearchModel model) + public KommentViewModel? GetElement(KommentSearchModel model) { if (string.IsNullOrEmpty(model.WorkPieceName) && !model.Id.HasValue) { @@ -51,9 +51,9 @@ namespace FurnitureAssemblyDatabaseImplement.Implements (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } - public WorkPieceViewModel? Insert(WorkPieceBindingModel model) + public KommentViewModel? Insert(KommentBindingModel model) { - var newWorkPiece = WorkPiece.Create(model); + var newWorkPiece = Komment.Create(model); if (newWorkPiece == null) { @@ -67,7 +67,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return newWorkPiece.GetViewModel; } - public WorkPieceViewModel? Update(WorkPieceBindingModel model) + public KommentViewModel? Update(KommentBindingModel model) { using var context = new FurnitureAssemblyDatabase(); var workPiece = context.WorkPieces.FirstOrDefault(x => x.Id == model.Id); @@ -83,7 +83,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return workPiece.GetViewModel; } - public WorkPieceViewModel? Delete(WorkPieceBindingModel model) + public KommentViewModel? Delete(KommentBindingModel model) { using var context = new FurnitureAssemblyDatabase(); var element = context.WorkPieces.FirstOrDefault(rec => rec.Id == model.Id); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/UsersStorage.cs similarity index 80% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/UsersStorage.cs index 6b6ab7d..930a57a 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/UsersStorage.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Implements { - public class FurnitureStorage : IFurnitureStorage + public class UsersStorage : IUsersStorage { public List GetFullList() { @@ -27,9 +27,9 @@ namespace FurnitureAssemblyDatabaseImplement.Implements .ToList(); } - public List GetFilteredList(FurnitureSearchModel model) + public List GetFilteredList(UsersSearchModel model) { - if (string.IsNullOrEmpty(model.FurnitureName)) + if (string.IsNullOrEmpty(model.UsersName)) { return new(); } @@ -39,15 +39,15 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return context.Furnitures .Include(x => x.WorkPieces) .ThenInclude(x => x.WorkPiece) - .Where(x => x.FurnitureName.Contains(model.FurnitureName)) + .Where(x => x.UsersName.Contains(model.UsersName)) .ToList() .Select(x => x.GetViewModel) .ToList(); } - public FurnitureViewModel? GetElement(FurnitureSearchModel model) + public FurnitureViewModel? GetElement(UsersSearchModel model) { - if (string.IsNullOrEmpty(model.FurnitureName) && !model.Id.HasValue) + if (string.IsNullOrEmpty(model.UsersName) && !model.Id.HasValue) { return null; } @@ -57,14 +57,14 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return context.Furnitures .Include(x => x.WorkPieces) .ThenInclude(x => x.WorkPiece) - .FirstOrDefault(x => (!string.IsNullOrEmpty(model.FurnitureName) && x.FurnitureName == model.FurnitureName) || + .FirstOrDefault(x => (!string.IsNullOrEmpty(model.UsersName) && x.UsersName == model.UsersName) || model.Id.HasValue && x.Id == model.Id)?.GetViewModel; } - public FurnitureViewModel? Insert(FurnitureBindingModel model) + public FurnitureViewModel? Insert(UsersBindingModel model) { using var context = new FurnitureAssemblyDatabase(); - var newFurniture = Furniture.Create(context, model); + var newFurniture = Users.Create(context, model); if (newFurniture == null) { @@ -77,7 +77,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements return newFurniture.GetViewModel; } - public FurnitureViewModel? Update(FurnitureBindingModel model) + public FurnitureViewModel? Update(UsersBindingModel model) { using var context = new FurnitureAssemblyDatabase(); using var transaction = context.Database.BeginTransaction(); @@ -105,7 +105,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements } } - public FurnitureViewModel? Delete(FurnitureBindingModel model) + public FurnitureViewModel? Delete(UsersBindingModel model) { using var context = new FurnitureAssemblyDatabase(); var element = context.Furnitures diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.Designer.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.Designer.cs index fe1007c..f828f92 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.Designer.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.Designer.cs @@ -33,7 +33,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("FurnitureName") + b.Property("UsersName") .IsRequired() .HasColumnType("nvarchar(max)"); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.cs index 6413913..bbef385 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240327064137_InitialCreate.cs @@ -17,7 +17,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - FurnitureName = table.Column(type: "nvarchar(max)", nullable: false), + UsersName = table.Column(type: "nvarchar(max)", nullable: false), Price = table.Column(type: "float", nullable: false) }, constraints: table => diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs index 9145a7b..dbb1af0 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs @@ -30,7 +30,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("FurnitureName") + b.Property("UsersName") .IsRequired() .HasColumnType("nvarchar(max)"); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Order.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Ad.cs similarity index 79% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Order.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Ad.cs index 9267bc1..6cd445c 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Order.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Ad.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Models { - public class Order : IOrderModel + public class Ad : IAdModel { public int Id { get; private set; } @@ -25,23 +25,23 @@ namespace FurnitureAssemblyDatabaseImplement.Models public double Sum { get; private set; } [Required] - public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; + public AdStatus Status { get; private set; } = AdStatus.Неизвестен; [Required] public DateTime DateCreate { get; private set; } = DateTime.Now; public DateTime? DateImplement { get; private set; } - public virtual Furniture Furniture { get; set; } + public virtual Users Furniture { get; set; } - public static Order? Create(OrderBindingModel model) + public static Ad? Create(AdBindingModel model) { if (model == null) { return null; } - return new Order() + return new Ad() { Id = model.Id, FurnitureId = model.FurnitureId, @@ -53,7 +53,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models }; } - public void Update(OrderBindingModel model) + public void Update(AdBindingModel model) { if (model == null) { @@ -64,7 +64,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models DateImplement = model.DateImplement; } - public OrderViewModel GetViewModel => new() + public AdViewModel GetViewModel => new() { Id = Id, FurnitureId = FurnitureId, @@ -73,7 +73,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models Status = Status, DateCreate = DateCreate, DateImplement = DateImplement, - FurnitureName = Furniture.FurnitureName + UsersName = Furniture.UsersName }; } } diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/WorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Komment.cs similarity index 75% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/WorkPiece.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Komment.cs index 8dcce39..387c224 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/WorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Komment.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Models { - public class WorkPiece : IWorkPieceModel + public class Komment : IKommentModel { public int Id { get; private set; } @@ -22,16 +22,16 @@ namespace FurnitureAssemblyDatabaseImplement.Models public double Cost { get; set; } [ForeignKey("WorkPieceId")] - public virtual List FurnitureWorkPieces { get; set; } = new(); + public virtual List FurnitureWorkPieces { get; set; } = new(); - public static WorkPiece? Create(WorkPieceBindingModel model) + public static Komment? Create(KommentBindingModel model) { if (model == null) { return null; } - return new WorkPiece() + return new Komment() { Id = model.Id, WorkPieceName = model.WorkPieceName, @@ -39,9 +39,9 @@ namespace FurnitureAssemblyDatabaseImplement.Models }; } - public static WorkPiece Create(WorkPieceViewModel model) + public static Komment Create(KommentViewModel model) { - return new WorkPiece + return new Komment { Id = model.Id, WorkPieceName = model.WorkPieceName, @@ -49,7 +49,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models }; } - public void Update(WorkPieceBindingModel model) + public void Update(KommentBindingModel model) { if (model == null) { @@ -60,7 +60,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models Cost = model.Cost; } - public WorkPieceViewModel GetViewModel => new() + public KommentViewModel GetViewModel => new() { Id = Id, WorkPieceName = WorkPieceName, diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Users.cs similarity index 73% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Users.cs index f7b7164..f5d0019 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Users.cs @@ -12,27 +12,27 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Models { - public class Furniture : IFurnitureModel + public class Users : IUsersModel { public int Id { get; set; } [Required] - public string FurnitureName { get; set; } = string.Empty; + public string UsersName { get; set; } = string.Empty; [Required] public double Price { get; set; } - public Dictionary? _furnitureWorkPieces = null; + public Dictionary? _furnitureWorkPieces = null; [NotMapped] - public Dictionary FurnitureWorkPieces + public Dictionary FurnitureWorkPieces { get { if (_furnitureWorkPieces == null) { _furnitureWorkPieces = WorkPieces - .ToDictionary(recPC => recPC.WorkPieceId, recPC => (recPC.WorkPiece as IWorkPieceModel, recPC.Count)); + .ToDictionary(recPC => recPC.WorkPieceId, recPC => (recPC.WorkPiece as IKommentModel, recPC.Count)); } return _furnitureWorkPieces; @@ -40,19 +40,19 @@ namespace FurnitureAssemblyDatabaseImplement.Models } [ForeignKey("FurnitureId")] - public virtual List WorkPieces { get; set; } = new(); + public virtual List WorkPieces { get; set; } = new(); [ForeignKey("FurnitureId")] - public virtual List Orders { get; set; } = new(); + public virtual List Orders { get; set; } = new(); - public static Furniture Create(FurnitureAssemblyDatabase context, FurnitureBindingModel model) + public static Users Create(FurnitureAssemblyDatabase context, UsersBindingModel model) { - return new Furniture() + return new Users() { Id = model.Id, - FurnitureName = model.FurnitureName, + UsersName = model.UsersName, Price = model.Price, - WorkPieces = model.FurnitureWorkPieces.Select(x => new FurnitureWorkPiece + WorkPieces = model.FurnitureWorkPieces.Select(x => new UsersKomment { WorkPiece = context.WorkPieces.First(y => y.Id == x.Key), Count = x.Value.Item2 @@ -60,24 +60,24 @@ namespace FurnitureAssemblyDatabaseImplement.Models }; } - public void Update(FurnitureBindingModel model) + public void Update(UsersBindingModel model) { - FurnitureName = model.FurnitureName; + UsersName = model.UsersName; Price = model.Price; } public FurnitureViewModel GetViewModel => new() { Id = Id, - FurnitureName = FurnitureName, + UsersName = UsersName, Price = Price, FurnitureWorkPieces = FurnitureWorkPieces }; - Dictionary IFurnitureModel.FurnitureWorkPieces => throw new NotImplementedException(); + Dictionary IUsersModel.FurnitureWorkPieces => throw new NotImplementedException(); - public void UpdateWorkPieces(FurnitureAssemblyDatabase context, FurnitureBindingModel model) + public void UpdateWorkPieces(FurnitureAssemblyDatabase context, UsersBindingModel model) { var furnitureWorkPieces = context.FurnitureWorkPieces.Where(rec => rec.FurnitureId == model.Id).ToList(); @@ -101,7 +101,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models foreach (var pc in model.FurnitureWorkPieces) { - context.FurnitureWorkPieces.Add(new FurnitureWorkPiece + context.FurnitureWorkPieces.Add(new UsersKomment { Furniture = furniture, WorkPiece = context.WorkPieces.First(x => x.Id == pc.Key), diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/FurnitureWorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/UsersKomment.cs similarity index 73% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/FurnitureWorkPiece.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/UsersKomment.cs index 688440d..fc7525c 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/FurnitureWorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/UsersKomment.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyDatabaseImplement.Models { - public class FurnitureWorkPiece + public class UsersKomment { public int Id { get; set; } @@ -20,8 +20,8 @@ namespace FurnitureAssemblyDatabaseImplement.Models [Required] public int Count { get; set; } - public virtual WorkPiece WorkPiece { get; set; } = new(); + public virtual Komment WorkPiece { get; set; } = new(); - public virtual Furniture Furniture { get; set; } = new(); + public virtual Users Furniture { get; set; } = new(); } } diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs index 079512c..faa7d26 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/DataFileSingleton.cs @@ -18,11 +18,11 @@ namespace FurnitureAssemblyFileImplement private readonly string FurnitureFileName = "Furniture.xml"; - public List WorkPieces { get; private set; } + public List WorkPieces { get; private set; } - public List Orders { get; private set; } + public List Orders { get; private set; } - public List Furnitures { get; private set; } + public List Furnitures { get; private set; } public static DataFileSingleton GetInstance() { @@ -43,9 +43,9 @@ namespace FurnitureAssemblyFileImplement private DataFileSingleton() { - WorkPieces = LoadData(WorkPieceFileName, "WorkPiece", x => WorkPiece.Create(x)!)!; - Furnitures = LoadData(FurnitureFileName, "Furniture", x => Furniture.Create(x)!)!; - Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; + WorkPieces = LoadData(WorkPieceFileName, "WorkPiece", x => Komment.Create(x)!)!; + Furnitures = LoadData(FurnitureFileName, "Furniture", x => Users.Create(x)!)!; + Orders = LoadData(OrderFileName, "Order", x => Ad.Create(x)!)!; } private static List? LoadData(string filename, string xmlNodeName, Func selectFunction) diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/AdStorage.cs similarity index 77% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/AdStorage.cs index d624de4..c359b49 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/AdStorage.cs @@ -11,21 +11,21 @@ using System.Threading.Tasks; namespace FurnitureAssemblyFileImplement.Implements { - public class OrderStorage : IOrderStorage + public class AdStorage : IAdStorage { private readonly DataFileSingleton source; - public OrderStorage() + public AdStorage() { source = DataFileSingleton.GetInstance(); } - public List GetFullList() + public List GetFullList() { return source.Orders.Select(x => GetViewModel(x)).ToList(); } - public List GetFilteredList(OrderSearchModel model) + public List GetFilteredList(AdSearchModel model) { if (!model.Id.HasValue) { @@ -35,7 +35,7 @@ namespace FurnitureAssemblyFileImplement.Implements return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList(); } - public OrderViewModel? GetElement(OrderSearchModel model) + public AdViewModel? GetElement(AdSearchModel model) { if (!model.Id.HasValue) { @@ -45,22 +45,22 @@ namespace FurnitureAssemblyFileImplement.Implements return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } - private OrderViewModel GetViewModel(Order order) + private AdViewModel GetViewModel(Ad order) { var viewModel = order.GetViewModel; var furniture = source.Furnitures.FirstOrDefault(x => x.Id == order.FurnitureId); - viewModel.FurnitureName = furniture?.FurnitureName; + viewModel.UsersName = furniture?.UsersName; return viewModel; } - public OrderViewModel? Insert(OrderBindingModel model) + public AdViewModel? Insert(AdBindingModel model) { model.Id = source.Orders.Count > 0 ? source.Orders.Max(x => x.Id) + 1 : 1; - var newOrder = Order.Create(model); + var newOrder = Ad.Create(model); if (newOrder == null) { @@ -73,7 +73,7 @@ namespace FurnitureAssemblyFileImplement.Implements return GetViewModel(newOrder); } - public OrderViewModel? Update(OrderBindingModel model) + public AdViewModel? Update(AdBindingModel model) { var order = source.Orders.FirstOrDefault(x => x.Id == model.Id); @@ -88,7 +88,7 @@ namespace FurnitureAssemblyFileImplement.Implements return GetViewModel(order); } - public OrderViewModel? Delete(OrderBindingModel model) + public AdViewModel? Delete(AdBindingModel model) { var element = source.Orders.FirstOrDefault(x => x.Id == model.Id); diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/WorkPieceStorage.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/KommentStorage.cs similarity index 80% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/WorkPieceStorage.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/KommentStorage.cs index 89aec60..7432ea6 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/WorkPieceStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/KommentStorage.cs @@ -11,21 +11,21 @@ using System.Threading.Tasks; namespace FurnitureAssemblyFileImplement.Implements { - public class WorkPieceStorage : IWorkPieceStorage + public class KommentStorage : IKommentStorage { private readonly DataFileSingleton source; - public WorkPieceStorage() + public KommentStorage() { source = DataFileSingleton.GetInstance(); } - public List GetFullList() + public List GetFullList() { return source.WorkPieces.Select(x => x.GetViewModel).ToList(); } - public List GetFilteredList(WorkPieceSearchModel model) + public List GetFilteredList(KommentSearchModel model) { if (string.IsNullOrEmpty(model.WorkPieceName)) { @@ -35,7 +35,7 @@ namespace FurnitureAssemblyFileImplement.Implements return source.WorkPieces.Where(x => x.WorkPieceName.Contains(model.WorkPieceName)).Select(x => x.GetViewModel).ToList(); } - public WorkPieceViewModel? GetElement(WorkPieceSearchModel model) + public KommentViewModel? GetElement(KommentSearchModel model) { if (string.IsNullOrEmpty(model.WorkPieceName) && !model.Id.HasValue) { @@ -46,11 +46,11 @@ namespace FurnitureAssemblyFileImplement.Implements || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } - public WorkPieceViewModel? Insert(WorkPieceBindingModel model) + public KommentViewModel? Insert(KommentBindingModel model) { model.Id = source.WorkPieces.Count > 0 ? source.WorkPieces.Max(x => x.Id) + 1 : 1; - var newWorkPiece = WorkPiece.Create(model); + var newWorkPiece = Komment.Create(model); if (newWorkPiece == null) { @@ -63,7 +63,7 @@ namespace FurnitureAssemblyFileImplement.Implements return newWorkPiece.GetViewModel; } - public WorkPieceViewModel? Update(WorkPieceBindingModel model) + public KommentViewModel? Update(KommentBindingModel model) { var workPiece = source.WorkPieces.FirstOrDefault(x => x.Id == model.Id); @@ -78,7 +78,7 @@ namespace FurnitureAssemblyFileImplement.Implements return workPiece.GetViewModel; } - public WorkPieceViewModel? Delete(WorkPieceBindingModel model) + public KommentViewModel? Delete(KommentBindingModel model) { var element = source.WorkPieces.FirstOrDefault(x => x.Id == model.Id); diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/FurnitureStorage.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/UsersStorage.cs similarity index 69% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/FurnitureStorage.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/UsersStorage.cs index bddc925..3af4a51 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/FurnitureStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/UsersStorage.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; namespace FurnitureAssemblyFileImplement.Implements { - public class FurnitureStorage : IFurnitureStorage + public class UsersStorage : IUsersStorage { private readonly DataFileSingleton source; - public FurnitureStorage() + public UsersStorage() { source = DataFileSingleton.GetInstance(); } @@ -25,32 +25,32 @@ namespace FurnitureAssemblyFileImplement.Implements return source.Furnitures.Select(x => x.GetViewModel).ToList(); } - public List GetFilteredList(FurnitureSearchModel model) + public List GetFilteredList(UsersSearchModel model) { - if (string.IsNullOrEmpty(model.FurnitureName)) + if (string.IsNullOrEmpty(model.UsersName)) { return new(); } - return source.Furnitures.Where(x => x.FurnitureName.Contains(model.FurnitureName)).Select(x => x.GetViewModel).ToList(); + return source.Furnitures.Where(x => x.UsersName.Contains(model.UsersName)).Select(x => x.GetViewModel).ToList(); } - public FurnitureViewModel? GetElement(FurnitureSearchModel model) + public FurnitureViewModel? GetElement(UsersSearchModel model) { - if (string.IsNullOrEmpty(model.FurnitureName) && !model.Id.HasValue) + if (string.IsNullOrEmpty(model.UsersName) && !model.Id.HasValue) { return null; } - return source.Furnitures.FirstOrDefault(x => (!string.IsNullOrEmpty(model.FurnitureName) && x.FurnitureName == model.FurnitureName) + return source.Furnitures.FirstOrDefault(x => (!string.IsNullOrEmpty(model.UsersName) && x.UsersName == model.UsersName) || (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } - public FurnitureViewModel? Insert(FurnitureBindingModel model) + public FurnitureViewModel? Insert(UsersBindingModel model) { model.Id = source.Furnitures.Count > 0 ? source.Furnitures.Max(x => x.Id) + 1 : 1; - var newFurniture = Furniture.Create(model); + var newFurniture = Users.Create(model); if (newFurniture == null) { @@ -63,7 +63,7 @@ namespace FurnitureAssemblyFileImplement.Implements return newFurniture.GetViewModel; } - public FurnitureViewModel? Update(FurnitureBindingModel model) + public FurnitureViewModel? Update(UsersBindingModel model) { var furniture = source.Furnitures.FirstOrDefault(x => x.Id == model.Id); @@ -78,7 +78,7 @@ namespace FurnitureAssemblyFileImplement.Implements return furniture.GetViewModel; } - public FurnitureViewModel? Delete(FurnitureBindingModel model) + public FurnitureViewModel? Delete(UsersBindingModel model) { var element = source.Furnitures.FirstOrDefault(x => x.Id == model.Id); diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Ad.cs similarity index 84% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Ad.cs index 246f9a6..149eaac 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Order.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Ad.cs @@ -11,7 +11,7 @@ using System.Xml.Linq; namespace FurnitureAssemblyFileImplement.Models { - public class Order : IOrderModel + public class Ad : IAdModel { public int Id { get; private set; } @@ -21,20 +21,20 @@ namespace FurnitureAssemblyFileImplement.Models public double Sum { get; private set; } - public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; + public AdStatus Status { get; private set; } = AdStatus.Неизвестен; public DateTime DateCreate { get; private set; } = DateTime.Now; public DateTime? DateImplement { get; private set; } - public static Order? Create(OrderBindingModel model) + public static Ad? Create(AdBindingModel model) { if (model == null) { return null; } - return new Order() + return new Ad() { Id = model.Id, FurnitureId = model.FurnitureId, @@ -46,27 +46,27 @@ namespace FurnitureAssemblyFileImplement.Models }; } - public static Order? Create(XElement element) + public static Ad? Create(XElement element) { if (element == null) { return null; } - return new Order() + return new Ad() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), FurnitureId = Convert.ToInt32(element.Element("FurnitureId")!.Value), Count = Convert.ToInt32(element.Element("Count")!.Value), Sum = Convert.ToDouble(element.Element("Sum")!.Value), - Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value), + Status = (AdStatus)Enum.Parse(typeof(AdStatus), element.Element("Status")!.Value), DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value), DateImplement = string.IsNullOrEmpty(element.Element("DateImplement")!.Value) ? null : Convert.ToDateTime(element.Element("DateImplement")!.Value) }; } - public void Update(OrderBindingModel model) + public void Update(AdBindingModel model) { if (model == null) { @@ -77,7 +77,7 @@ namespace FurnitureAssemblyFileImplement.Models DateImplement = model.DateImplement; } - public OrderViewModel GetViewModel => new() + public AdViewModel GetViewModel => new() { Id = Id, FurnitureId = FurnitureId, diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/WorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Komment.cs similarity index 82% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Models/WorkPiece.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Komment.cs index 429c634..07c7898 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/WorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Komment.cs @@ -10,7 +10,7 @@ using System.Xml.Linq; namespace FurnitureAssemblyFileImplement.Models { - public class WorkPiece : IWorkPieceModel + public class Komment : IKommentModel { public int Id { get; private set; } @@ -18,14 +18,14 @@ namespace FurnitureAssemblyFileImplement.Models public double Cost { get; set; } - public static WorkPiece? Create(WorkPieceBindingModel model) + public static Komment? Create(KommentBindingModel model) { if (model == null) { return null; } - return new WorkPiece() + return new Komment() { Id = model.Id, WorkPieceName = model.WorkPieceName, @@ -33,14 +33,14 @@ namespace FurnitureAssemblyFileImplement.Models }; } - public static WorkPiece? Create(XElement element) + public static Komment? Create(XElement element) { if (element == null) { return null; } - return new WorkPiece() + return new Komment() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), WorkPieceName = element.Element("WorkPieceName")!.Value, @@ -48,7 +48,7 @@ namespace FurnitureAssemblyFileImplement.Models }; } - public void Update(WorkPieceBindingModel model) + public void Update(KommentBindingModel model) { if (model == null) { @@ -59,7 +59,7 @@ namespace FurnitureAssemblyFileImplement.Models Cost = model.Cost; } - public WorkPieceViewModel GetViewModel => new() + public KommentViewModel GetViewModel => new() { Id = Id, WorkPieceName = WorkPieceName, diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Furniture.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Users.cs similarity index 75% rename from FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Furniture.cs rename to FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Users.cs index 38d6d34..dd3eee7 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Furniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Models/Users.cs @@ -10,19 +10,19 @@ using System.Xml.Linq; namespace FurnitureAssemblyFileImplement.Models { - public class Furniture : IFurnitureModel + public class Users : IUsersModel { public int Id { get; private set; } - public string FurnitureName { get; private set; } = string.Empty; + public string UsersName { get; private set; } = string.Empty; public double Price { get; private set; } public Dictionary WorkPieces { get; private set; } = new(); - private Dictionary? _furnitureWorkPieces = null; + private Dictionary? _furnitureWorkPieces = null; - public Dictionary FurnitureWorkPieces + public Dictionary FurnitureWorkPieces { get { @@ -31,40 +31,40 @@ namespace FurnitureAssemblyFileImplement.Models var source = DataFileSingleton.GetInstance(); _furnitureWorkPieces = WorkPieces.ToDictionary(x => x.Key, - y => ((source.WorkPieces.FirstOrDefault(z => z.Id == y.Key) as IWorkPieceModel)!, y.Value)); + y => ((source.WorkPieces.FirstOrDefault(z => z.Id == y.Key) as IKommentModel)!, y.Value)); } return _furnitureWorkPieces; } } - public static Furniture? Create(FurnitureBindingModel model) + public static Users? Create(UsersBindingModel model) { if (model == null) { return null; } - return new Furniture() + return new Users() { Id = model.Id, - FurnitureName = model.FurnitureName, + UsersName = model.UsersName, Price = model.Price, WorkPieces = model.FurnitureWorkPieces.ToDictionary(x => x.Key, x => x.Value.Item2) }; } - public static Furniture? Create(XElement element) + public static Users? Create(XElement element) { if (element == null) { return null; } - return new Furniture() + return new Users() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), - FurnitureName = element.Element("FurnitureName")!.Value, + UsersName = element.Element("UsersName")!.Value, Price = Convert.ToDouble(element.Element("Price")!.Value), WorkPieces = element.Element("FurnitureWorkPieces")!.Elements("FurnitureWorkPieces").ToDictionary( x => Convert.ToInt32(x.Element("Key")?.Value), @@ -72,14 +72,14 @@ namespace FurnitureAssemblyFileImplement.Models }; } - public void Update(FurnitureBindingModel model) + public void Update(UsersBindingModel model) { if (model == null) { return; } - FurnitureName = model.FurnitureName; + UsersName = model.UsersName; Price = model.Price; WorkPieces = model.FurnitureWorkPieces.ToDictionary(x => x.Key, x => x.Value.Item2); _furnitureWorkPieces = null; @@ -88,14 +88,14 @@ namespace FurnitureAssemblyFileImplement.Models public FurnitureViewModel GetViewModel => new() { Id = Id, - FurnitureName = FurnitureName, + UsersName = UsersName, Price = Price, FurnitureWorkPieces = FurnitureWorkPieces }; public XElement GetXElement => new("Furniture", new XAttribute("Id", Id), - new XElement("FurnitureName", FurnitureName), + new XElement("UsersName", UsersName), new XElement("Price", Price.ToString()), new XElement("FurnitureWorkPieces", WorkPieces.Select( x => new XElement("FurnitureWorkPieces", diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs index 6fa7e16..15fc966 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/DataListSingleton.cs @@ -10,17 +10,17 @@ namespace FurnitureAssemblyListImplement public class DataListSingleton { private static DataListSingleton? _instance; - public List Orders { get; set; } - public List Furnitures { get; set; } + public List Orders { get; set; } + public List Furnitures { get; set; } - public List WorkPiece { get; set; } + public List WorkPiece { get; set; } public DataListSingleton() { - WorkPiece = new List(); - Furnitures = new List(); - Orders = new List(); + WorkPiece = new List(); + Furnitures = new List(); + Orders = new List(); } public static DataListSingleton GetInstance() diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/OrderStorage.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/AdStorage.cs similarity index 79% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Implements/OrderStorage.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Implements/AdStorage.cs index 96649c8..5e4e07a 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/OrderStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/AdStorage.cs @@ -12,18 +12,18 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Implements { // Класс, реализующий интерфейс хранилища заказов - public class OrderStorage : IOrderStorage + public class AdStorage : IAdStorage { private readonly DataListSingleton _source; - public OrderStorage() + public AdStorage() { _source = DataListSingleton.GetInstance(); } - public List GetFullList() + public List GetFullList() { - var result = new List(); + var result = new List(); foreach(var order in _source.Orders) { @@ -33,9 +33,9 @@ namespace FurnitureAssemblyListImplement.Implements return result; } - public List GetFilteredList(OrderSearchModel model) + public List GetFilteredList(AdSearchModel model) { - var result = new List(); + var result = new List(); if(!model.Id.HasValue) { @@ -53,7 +53,7 @@ namespace FurnitureAssemblyListImplement.Implements return result; } - public OrderViewModel? GetElement(OrderSearchModel model) + public AdViewModel? GetElement(AdSearchModel model) { if (!model.Id.HasValue) { @@ -71,7 +71,7 @@ namespace FurnitureAssemblyListImplement.Implements return null; } - private OrderViewModel GetViewModel(Order order) + private AdViewModel GetViewModel(Ad order) { var viewModel = order.GetViewModel; @@ -79,7 +79,7 @@ namespace FurnitureAssemblyListImplement.Implements { if (furniture.Id == order.FurnitureId) { - viewModel.FurnitureName = furniture.FurnitureName; + viewModel.UsersName = furniture.UsersName; break; } @@ -88,7 +88,7 @@ namespace FurnitureAssemblyListImplement.Implements return viewModel; } - public OrderViewModel? Insert(OrderBindingModel model) + public AdViewModel? Insert(AdBindingModel model) { model.Id = 1; @@ -100,7 +100,7 @@ namespace FurnitureAssemblyListImplement.Implements } } - var newOrder = Order.Create(model); + var newOrder = Ad.Create(model); if(newOrder == null) { @@ -111,7 +111,7 @@ namespace FurnitureAssemblyListImplement.Implements return GetViewModel(newOrder); } - public OrderViewModel? Update(OrderBindingModel model) + public AdViewModel? Update(AdBindingModel model) { foreach(var order in _source.Orders) { @@ -126,7 +126,7 @@ namespace FurnitureAssemblyListImplement.Implements return null; } - public OrderViewModel? Delete(OrderBindingModel model) + public AdViewModel? Delete(AdBindingModel model) { for(int i = 0; i < _source.Orders.Count; i++) { diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/WorkPieceStorage.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/KommentStorage.cs similarity index 84% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Implements/WorkPieceStorage.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Implements/KommentStorage.cs index a803ea3..bf5a280 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/WorkPieceStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/KommentStorage.cs @@ -12,21 +12,21 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Implements { // Класс, реализующий интерфейс хранилища заготовок - public class WorkPieceStorage : IWorkPieceStorage + public class KommentStorage : IKommentStorage { // Поле для работы со списком заготовок private readonly DataListSingleton _source; // Получение в конструкторе объекта DataListSingleton - public WorkPieceStorage() + public KommentStorage() { _source = DataListSingleton.GetInstance(); } // Получение полного списка заготовок - public List GetFullList() + public List GetFullList() { - var result = new List(); + var result = new List(); foreach(var workPiece in _source.WorkPiece) { @@ -37,9 +37,9 @@ namespace FurnitureAssemblyListImplement.Implements } // Получение отфильтрованного списка заготовок - public List GetFilteredList(WorkPieceSearchModel model) + public List GetFilteredList(KommentSearchModel model) { - var result = new List(); + var result = new List(); if(string.IsNullOrEmpty(model.WorkPieceName)) { @@ -58,7 +58,7 @@ namespace FurnitureAssemblyListImplement.Implements } // Получение элемента из списка заготовок - public WorkPieceViewModel? GetElement(WorkPieceSearchModel model) + public KommentViewModel? GetElement(KommentSearchModel model) { if(string.IsNullOrEmpty(model.WorkPieceName) && !model.Id.HasValue) { @@ -78,7 +78,7 @@ namespace FurnitureAssemblyListImplement.Implements } // При создании заготовки определяем для него новый id: ищем max id и прибавляем к нему 1 - public WorkPieceViewModel? Insert(WorkPieceBindingModel model) + public KommentViewModel? Insert(KommentBindingModel model) { model.Id = 1; @@ -90,7 +90,7 @@ namespace FurnitureAssemblyListImplement.Implements } } - var newWorkPiece = WorkPiece.Create(model); + var newWorkPiece = Komment.Create(model); if(newWorkPiece == null) { @@ -103,7 +103,7 @@ namespace FurnitureAssemblyListImplement.Implements } // Обновление заготовки - public WorkPieceViewModel? Update(WorkPieceBindingModel model) + public KommentViewModel? Update(KommentBindingModel model) { foreach(var workPiece in _source.WorkPiece) { @@ -119,7 +119,7 @@ namespace FurnitureAssemblyListImplement.Implements } // Удаление заготовки - public WorkPieceViewModel? Delete(WorkPieceBindingModel model) + public KommentViewModel? Delete(KommentBindingModel model) { for(int i = 0; i < _source.WorkPiece.Count; i++) { diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/FurnitureStorage.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/UsersStorage.cs similarity index 80% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Implements/FurnitureStorage.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Implements/UsersStorage.cs index ca8d068..50e4d2f 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/FurnitureStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Implements/UsersStorage.cs @@ -12,13 +12,13 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Implements { // Класс, реализующий интерфейс хранилища изделий - public class FurnitureStorage : IFurnitureStorage + public class UsersStorage : IUsersStorage { // Поле для работы со списком изделий private readonly DataListSingleton _source; // Получение в конструкторе объекта DataListSingleton - public FurnitureStorage() + public UsersStorage() { _source = DataListSingleton.GetInstance(); } @@ -37,18 +37,18 @@ namespace FurnitureAssemblyListImplement.Implements } // Получение отфильтрованного списка изделий - public List GetFilteredList(FurnitureSearchModel model) + public List GetFilteredList(UsersSearchModel model) { var result = new List(); - if(string.IsNullOrEmpty(model.FurnitureName)) + if(string.IsNullOrEmpty(model.UsersName)) { return result; } foreach(var furniture in _source.Furnitures) { - if (furniture.FurnitureName.Contains(model.FurnitureName)) + if (furniture.UsersName.Contains(model.UsersName)) { result.Add(furniture.GetViewModel); } @@ -58,16 +58,16 @@ namespace FurnitureAssemblyListImplement.Implements } // Получение элемента из списка изделий - public FurnitureViewModel? GetElement(FurnitureSearchModel model) + public FurnitureViewModel? GetElement(UsersSearchModel model) { - if (string.IsNullOrEmpty(model.FurnitureName) && !model.Id.HasValue) + if (string.IsNullOrEmpty(model.UsersName) && !model.Id.HasValue) { return null; } foreach(var furniture in _source.Furnitures) { - if((!string.IsNullOrEmpty(model.FurnitureName) && furniture.FurnitureName == model.FurnitureName) || + if((!string.IsNullOrEmpty(model.UsersName) && furniture.UsersName == model.UsersName) || (model.Id.HasValue && furniture.Id == model.Id)) { return furniture.GetViewModel; @@ -78,7 +78,7 @@ namespace FurnitureAssemblyListImplement.Implements } // При создании изделия определяем для него новый id: ищем max id и прибавлляем к нему 1 - public FurnitureViewModel? Insert(FurnitureBindingModel model) + public FurnitureViewModel? Insert(UsersBindingModel model) { model.Id = 1; @@ -90,7 +90,7 @@ namespace FurnitureAssemblyListImplement.Implements } } - var newFurniture = Furniture.Create(model); + var newFurniture = Users.Create(model); if(newFurniture == null) { @@ -103,7 +103,7 @@ namespace FurnitureAssemblyListImplement.Implements } // Обновление изделия - public FurnitureViewModel? Update(FurnitureBindingModel model) + public FurnitureViewModel? Update(UsersBindingModel model) { foreach(var furniture in _source.Furnitures) { @@ -119,7 +119,7 @@ namespace FurnitureAssemblyListImplement.Implements } // Удаление изделия - public FurnitureViewModel? Delete(FurnitureBindingModel model) + public FurnitureViewModel? Delete(UsersBindingModel model) { for(int i = 0; i < _source.Furnitures.Count; ++i) { diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Ad.cs similarity index 87% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Models/Ad.cs index 92db798..c3be4bf 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Order.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Ad.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Models { // Класс, реализующий интерфейс модели заказа - public class Order : IOrderModel + public class Ad : IAdModel { // Методы set сделали приватными, чтобы исключить неразрешённые манипуляции public int Id { get; private set; } @@ -22,20 +22,20 @@ namespace FurnitureAssemblyListImplement.Models public double Sum { get; private set; } - public OrderStatus Status { get; private set; } + public AdStatus Status { get; private set; } public DateTime DateCreate { get; private set; } = DateTime.Now; public DateTime? DateImplement { get; private set; } - public static Order? Create(OrderBindingModel? model) + public static Ad? Create(AdBindingModel? model) { if(model == null) { return null; } - return new Order() + return new Ad() { Id = model.Id, FurnitureId = model.FurnitureId, @@ -48,7 +48,7 @@ namespace FurnitureAssemblyListImplement.Models } // Метод изменения существующего объекта - public void Update(OrderBindingModel? model) + public void Update(AdBindingModel? model) { if(model == null) { @@ -59,7 +59,7 @@ namespace FurnitureAssemblyListImplement.Models } // Метод для создания объекта класса ViewModel на основе данных объекта класса-компонента - public OrderViewModel GetViewModel => new() + public AdViewModel GetViewModel => new() { Id = Id, FurnitureId = FurnitureId, diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/WorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Komment.cs similarity index 86% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Models/WorkPiece.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Models/Komment.cs index e9e655e..3389458 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/WorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Komment.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Models { // Реализация интерфейса модели заготовки - public class WorkPiece : IWorkPieceModel + public class Komment : IKommentModel { // Методы set делаем приватным, чтобы исключить неразрешённые манипуляции public int Id { get; private set; } @@ -20,14 +20,14 @@ namespace FurnitureAssemblyListImplement.Models public double Cost { get; private set; } // Метод для создания объекта от класса-компонента на основе класса-BindingModel - public static WorkPiece? Create(WorkPieceBindingModel? model) + public static Komment? Create(KommentBindingModel? model) { if(model == null) { return null; } - return new WorkPiece() + return new Komment() { Id = model.Id, WorkPieceName = model.WorkPieceName, @@ -36,7 +36,7 @@ namespace FurnitureAssemblyListImplement.Models } // Метод изменения существующего объекта - public void Update(WorkPieceBindingModel? model) + public void Update(KommentBindingModel? model) { if(model == null) { @@ -48,7 +48,7 @@ namespace FurnitureAssemblyListImplement.Models } // Метод для создания объекта класса ViewModel на основе данных объекта класса-компонента - public WorkPieceViewModel GetViewModel => new() + public KommentViewModel GetViewModel => new() { Id = Id, WorkPieceName = WorkPieceName, diff --git a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Furniture.cs b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Users.cs similarity index 74% rename from FurnitureAssembly/FurnitureAssemblyListImplement/Models/Furniture.cs rename to FurnitureAssembly/FurnitureAssemblyListImplement/Models/Users.cs index fe89da8..edd1947 100644 --- a/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Furniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyListImplement/Models/Users.cs @@ -10,43 +10,43 @@ using System.Threading.Tasks; namespace FurnitureAssemblyListImplement.Models { // Класс реализующий интерфейс модели изделия - public class Furniture : IFurnitureModel + public class Users : IUsersModel { // Методы set делаем приватным, чтобы исключить неразрешённые манипуляции public int Id { get; private set; } - public string FurnitureName { get; private set; } = string.Empty; + public string UsersName { get; private set; } = string.Empty; public double Price { get; private set; } - public Dictionary FurnitureWorkPieces { get; private set; } = new Dictionary(); + public Dictionary FurnitureWorkPieces { get; private set; } = new Dictionary(); // Метод для создания объекта от класса-компонента на основе класса-BindingModel - public static Furniture? Create(FurnitureBindingModel? model) + public static Users? Create(UsersBindingModel? model) { if(model == null) { return null; } - return new Furniture() + return new Users() { Id = model.Id, - FurnitureName = model.FurnitureName, + UsersName = model.UsersName, Price = model.Price, FurnitureWorkPieces = model.FurnitureWorkPieces }; } // Метод изменения существующего объекта - public void Update(FurnitureBindingModel? model) + public void Update(UsersBindingModel? model) { if(model == null) { return; } - FurnitureName = model.FurnitureName; + UsersName = model.UsersName; Price = model.Price; FurnitureWorkPieces = model.FurnitureWorkPieces; } @@ -55,7 +55,7 @@ namespace FurnitureAssemblyListImplement.Models public FurnitureViewModel GetViewModel => new() { Id = Id, - FurnitureName = FurnitureName, + UsersName = UsersName, Price = Price, FurnitureWorkPieces = FurnitureWorkPieces }; diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormCreateOrder.cs b/FurnitureAssembly/FurnitureAssemblyView/FormCreateOrder.cs index d7d0ad9..19da819 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormCreateOrder.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormCreateOrder.cs @@ -19,11 +19,11 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IFurnitureLogic _logicM; + private readonly IUsersLogic _logicM; - private readonly IOrderLogic _logicO; + private readonly IAdLogic _logicO; - public FormCreateOrder(ILogger logger, IFurnitureLogic logicM, IOrderLogic logicO) + public FormCreateOrder(ILogger logger, IUsersLogic logicM, IAdLogic logicO) { InitializeComponent(); @@ -42,7 +42,7 @@ namespace FurnitureAssemblyView if (list != null) { - comboBoxFurniture.DisplayMember = "FurnitureName"; + comboBoxFurniture.DisplayMember = "UsersName"; comboBoxFurniture.ValueMember = "Id"; comboBoxFurniture.DataSource = list; comboBoxFurniture.SelectedItem = null; @@ -64,7 +64,7 @@ namespace FurnitureAssemblyView { int id = Convert.ToInt32(comboBoxFurniture.SelectedValue); - var furniture = _logicM.ReadElement(new FurnitureSearchModel + var furniture = _logicM.ReadElement(new UsersSearchModel { Id = id }); @@ -113,7 +113,7 @@ namespace FurnitureAssemblyView try { - var operationResult = _logicO.CreateOrder(new OrderBindingModel + var operationResult = _logicO.CreateOrder(new AdBindingModel { FurnitureId = Convert.ToInt32(comboBoxFurniture.SelectedValue), Count = Convert.ToInt32(textBoxCount.Text), diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormFurniture.cs b/FurnitureAssembly/FurnitureAssemblyView/FormFurniture.cs index d52ab40..7a24816 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormFurniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormFurniture.cs @@ -19,21 +19,21 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IFurnitureLogic _logic; + private readonly IUsersLogic _logic; private int? _id; - private Dictionary _furnitureWorkPieces; + private Dictionary _furnitureWorkPieces; public int Id { set { _id = value; } } - public FormFurniture(ILogger logger, IFurnitureLogic logic) + public FormFurniture(ILogger logger, IUsersLogic logic) { InitializeComponent(); _logger = logger; _logic = logic; - _furnitureWorkPieces = new Dictionary(); + _furnitureWorkPieces = new Dictionary(); } private void FormFurniture_Load(object sender, EventArgs e) @@ -44,13 +44,13 @@ namespace FurnitureAssemblyView try { - var view = _logic.ReadElement(new FurnitureSearchModel { Id = _id.Value }); + var view = _logic.ReadElement(new UsersSearchModel { Id = _id.Value }); if(view != null) { - textBoxName.Text = view.FurnitureName; + textBoxName.Text = view.UsersName; textBoxPrice.Text = view.Price.ToString(); - _furnitureWorkPieces = view.FurnitureWorkPieces ?? new Dictionary(); + _furnitureWorkPieces = view.FurnitureWorkPieces ?? new Dictionary(); LoadData(); } } @@ -197,10 +197,10 @@ namespace FurnitureAssemblyView try { - var model = new FurnitureBindingModel + var model = new UsersBindingModel { Id = _id ?? 0, - FurnitureName = textBoxName.Text, + UsersName = textBoxName.Text, Price = Convert.ToDouble(textBoxPrice.Text), FurnitureWorkPieces = _furnitureWorkPieces }; diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormFurnitureWorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyView/FormFurnitureWorkPiece.cs index 4d8c935..ea2a00e 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormFurnitureWorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormFurnitureWorkPiece.cs @@ -16,7 +16,7 @@ namespace FurnitureAssemblyView { public partial class FormFurnitureWorkPiece : Form { - private readonly List? _list; + private readonly List? _list; public int Id { @@ -24,7 +24,7 @@ namespace FurnitureAssemblyView set { comboBoxWorkPiece.SelectedValue = value; } } - public IWorkPieceModel? WorkPieceModel + public IKommentModel? WorkPieceModel { get { @@ -54,7 +54,7 @@ namespace FurnitureAssemblyView } } - public FormFurnitureWorkPiece(IWorkPieceLogic logic) + public FormFurnitureWorkPiece(IKommentLogic logic) { InitializeComponent(); diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormFurnitures.cs b/FurnitureAssembly/FurnitureAssemblyView/FormFurnitures.cs index 4bfd6b9..16a56df 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormFurnitures.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormFurnitures.cs @@ -17,9 +17,9 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IFurnitureLogic _logic; + private readonly IUsersLogic _logic; - public FormFurnitures(ILogger logger, IFurnitureLogic logic) + public FormFurnitures(ILogger logger, IUsersLogic logic) { InitializeComponent(); @@ -44,7 +44,7 @@ namespace FurnitureAssemblyView dataGridView.DataSource = list; dataGridView.Columns["Id"].Visible = false; dataGridView.Columns["FurnitureWorkPieces"].Visible = false; - dataGridView.Columns["FurnitureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dataGridView.Columns["UsersName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } _logger.LogInformation("Загрузка изделий"); @@ -99,7 +99,7 @@ namespace FurnitureAssemblyView try { - if (!_logic.Delete(new FurnitureBindingModel + if (!_logic.Delete(new UsersBindingModel { Id = id })) diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormMain.Designer.cs b/FurnitureAssembly/FurnitureAssemblyView/FormMain.Designer.cs index 40e5f1e..e7afbb6 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormMain.Designer.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormMain.Designer.cs @@ -60,7 +60,7 @@ this.buttonCreateOrder.Name = "buttonCreateOrder"; this.buttonCreateOrder.Size = new System.Drawing.Size(178, 34); this.buttonCreateOrder.TabIndex = 1; - this.buttonCreateOrder.Text = "Создать заказ"; + this.buttonCreateOrder.Text = "Создать Объявление"; this.buttonCreateOrder.UseVisualStyleBackColor = true; this.buttonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click); // @@ -69,37 +69,37 @@ this.buttonTakeOrderInWork.Location = new System.Drawing.Point(820, 65); this.buttonTakeOrderInWork.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - this.buttonTakeOrderInWork.Size = new System.Drawing.Size(178, 36); + this.buttonTakeOrderInWork.Size = new System.Drawing.Size(178, 56); this.buttonTakeOrderInWork.TabIndex = 2; - this.buttonTakeOrderInWork.Text = "Отдать на выполнение"; + this.buttonTakeOrderInWork.Text = "Доставка (выполнение) объявления"; this.buttonTakeOrderInWork.UseVisualStyleBackColor = true; this.buttonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); // // buttonOrderReady // - this.buttonOrderReady.Location = new System.Drawing.Point(820, 105); + this.buttonOrderReady.Location = new System.Drawing.Point(820, 125); this.buttonOrderReady.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOrderReady.Name = "buttonOrderReady"; this.buttonOrderReady.Size = new System.Drawing.Size(178, 31); this.buttonOrderReady.TabIndex = 3; - this.buttonOrderReady.Text = "Заказ готов"; + this.buttonOrderReady.Text = "Товар готов"; this.buttonOrderReady.UseVisualStyleBackColor = true; this.buttonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click); // // buttonIssuedOrder // - this.buttonIssuedOrder.Location = new System.Drawing.Point(820, 140); + this.buttonIssuedOrder.Location = new System.Drawing.Point(820, 160); this.buttonIssuedOrder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonIssuedOrder.Name = "buttonIssuedOrder"; this.buttonIssuedOrder.Size = new System.Drawing.Size(178, 33); this.buttonIssuedOrder.TabIndex = 4; - this.buttonIssuedOrder.Text = "Заказ выдан"; + this.buttonIssuedOrder.Text = "Товар выдан покупателю"; this.buttonIssuedOrder.UseVisualStyleBackColor = true; this.buttonIssuedOrder.Click += new System.EventHandler(this.ButtonIssuedOrder_Click); // // buttonRefresh // - this.buttonRefresh.Location = new System.Drawing.Point(820, 177); + this.buttonRefresh.Location = new System.Drawing.Point(820, 197); this.buttonRefresh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonRefresh.Name = "buttonRefresh"; this.buttonRefresh.Size = new System.Drawing.Size(178, 29); @@ -126,21 +126,21 @@ this.workPieceToolStripMenuItem, this.furnitureToolStripMenuItem}); this.toolStripMenuItem.Name = "toolStripMenuItem"; - this.toolStripMenuItem.Size = new System.Drawing.Size(94, 20); - this.toolStripMenuItem.Text = "Справочники"; + this.toolStripMenuItem.Size = new System.Drawing.Size(85, 20); + this.toolStripMenuItem.Text = "Управление"; // // workPieceToolStripMenuItem // this.workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; - this.workPieceToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.workPieceToolStripMenuItem.Text = "Заготовки"; + this.workPieceToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.workPieceToolStripMenuItem.Text = "Комментарии"; this.workPieceToolStripMenuItem.Click += new System.EventHandler(this.WorkPieceToolStripMenuItem_Click); // // furnitureToolStripMenuItem // this.furnitureToolStripMenuItem.Name = "furnitureToolStripMenuItem"; - this.furnitureToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.furnitureToolStripMenuItem.Text = "Изделия"; + this.furnitureToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.furnitureToolStripMenuItem.Text = "Пользователи"; this.furnitureToolStripMenuItem.Click += new System.EventHandler(this.FurnitureToolStripMenuItem_Click); // // FormMain @@ -158,7 +158,7 @@ this.MainMenuStrip = this.menuStrip; this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "FormMain"; - this.Text = "Сборка мебели"; + this.Text = "Объявления"; this.Load += new System.EventHandler(this.FormMain_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.menuStrip.ResumeLayout(false); diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs b/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs index fcbb570..9b50bb2 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormMain.cs @@ -18,9 +18,9 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IOrderLogic _orderLogic; + private readonly IAdLogic _orderLogic; - public FormMain(ILogger logger, IOrderLogic orderLogic) + public FormMain(ILogger logger, IAdLogic orderLogic) { InitializeComponent(); @@ -97,7 +97,7 @@ namespace FurnitureAssemblyView try { - var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel + var operationResult = _orderLogic.TakeOrderInWork(new AdBindingModel { Id = id }); @@ -126,7 +126,7 @@ namespace FurnitureAssemblyView try { - var operationResult = _orderLogic.FinishOrder(new OrderBindingModel + var operationResult = _orderLogic.FinishOrder(new AdBindingModel { Id = id }); @@ -155,7 +155,7 @@ namespace FurnitureAssemblyView try { - var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel + var operationResult = _orderLogic.DeliveryOrder(new AdBindingModel { Id = id }); diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormWorkPiece.cs b/FurnitureAssembly/FurnitureAssemblyView/FormWorkPiece.cs index cc54a89..57fb52c 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormWorkPiece.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormWorkPiece.cs @@ -10,14 +10,14 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IWorkPieceLogic _logic; + private readonly IKommentLogic _logic; private int? _id; public int Id { set { _id = value; } } // - public FormWorkPiece(ILogger logger, IWorkPieceLogic logic) + public FormWorkPiece(ILogger logger, IKommentLogic logic) { InitializeComponent(); @@ -35,7 +35,7 @@ namespace FurnitureAssemblyView { _logger.LogInformation(" "); - var view = _logic.ReadElement(new WorkPieceSearchModel { Id = _id.Value }); + var view = _logic.ReadElement(new KommentSearchModel { Id = _id.Value }); if(view != null) { @@ -67,7 +67,7 @@ namespace FurnitureAssemblyView try { - var model = new WorkPieceBindingModel + var model = new KommentBindingModel { Id = _id ?? 0, WorkPieceName = textBoxName.Text, diff --git a/FurnitureAssembly/FurnitureAssemblyView/FormWorkPieces.cs b/FurnitureAssembly/FurnitureAssemblyView/FormWorkPieces.cs index 303f88b..6029257 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/FormWorkPieces.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/FormWorkPieces.cs @@ -18,9 +18,9 @@ namespace FurnitureAssemblyView { private readonly ILogger _logger; - private readonly IWorkPieceLogic _logic; + private readonly IKommentLogic _logic; - public FormWorkPieces(ILogger logger, IWorkPieceLogic logic) + public FormWorkPieces(ILogger logger, IKommentLogic logic) { InitializeComponent(); _logger = logger; @@ -101,7 +101,7 @@ namespace FurnitureAssemblyView try { - if (!_logic.Delete(new WorkPieceBindingModel + if (!_logic.Delete(new KommentBindingModel { Id = id })) diff --git a/FurnitureAssembly/FurnitureAssemblyView/Program.cs b/FurnitureAssembly/FurnitureAssemblyView/Program.cs index 18bddb4..0b67161 100644 --- a/FurnitureAssembly/FurnitureAssemblyView/Program.cs +++ b/FurnitureAssembly/FurnitureAssemblyView/Program.cs @@ -36,13 +36,13 @@ namespace FurnitureAssemblyView option.AddNLog("nlog.config"); }); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient();