From 03a67a839706ba08283ca766969ea4ae729a7927 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Sun, 29 Jan 2023 22:45:01 +0400 Subject: [PATCH 01/12] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=D0=BC=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stractSofrwareInstallationContracts.csproj | 38 +++++ .../BindingModels/ComponentBindingModel.cs | 18 +++ .../BindingModels/OrderBindingModel.cs | 27 ++++ .../BindingModels/PackageBindingModel.cs | 20 +++ .../IComponentLogic.cs | 20 +++ .../BusinessLogicsContracts/IOrderLogic.cs | 20 +++ .../BusinessLogicsContracts/IPackageLogic.cs | 20 +++ .../SearchModels/ComponentSearchModel.cs | 14 ++ .../SearchModels/OrderSearchModel.cs | 13 ++ .../SearchModels/PackageSearchModel.cs | 14 ++ .../StoragesContracts/IComponentStorage.cs | 21 +++ .../StoragesContracts/IOrderStorage.cs | 21 +++ .../StoragesContracts/IPackageStorage.cs | 21 +++ .../ViewModels/ComponentViewModel.cs | 21 +++ .../ViewModels/OrderViewModel.cs | 34 +++++ .../ViewModels/PackageViewModel.cs | 23 +++ ...ctSoftwareInstallationBusinessLogic.csproj | 38 +++++ .../BusinessLogic/ComponentLogic.cs | 142 ++++++++++++++++++ .../BusinessLogic/OrderLogic.cs | 42 ++++++ .../BusinessLogic/PackageLogic.cs | 142 ++++++++++++++++++ ...tractSoftwareInstallationDataModels.csproj | 34 +++++ .../Enums/OrderStatus.cs | 17 +++ .../IId.cs | 13 ++ .../Models/IComponentModel.cs | 14 ++ .../Models/IOrderModel.cs | 19 +++ .../Models/IPackageModel.cs | 15 ++ ...ctSoftwareInstallationListImplement.csproj | 14 ++ .../DataListSingleton.cs | 33 ++++ .../Implements/ComponentStorage.cs | 124 +++++++++++++++ .../Implements/OrderStorage.cs | 124 +++++++++++++++ .../Implements/PackageStorage.cs | 126 ++++++++++++++++ .../Models/Component.cs | 51 +++++++ .../Models/Order.cs | 73 +++++++++ .../Models/Package.cs | 56 +++++++ SoftwareInstallation/SoftwareInstallation.sln | 26 +++- .../SoftwareInstallation.csproj | 25 +++ 36 files changed, 1472 insertions(+), 1 deletion(-) create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs create mode 100644 SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj b/SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj new file mode 100644 index 0000000..9124162 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj @@ -0,0 +1,38 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..1cc1f5d --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Models; + +namespace AbstractSofrwareInstallationContracts.BindingModels +{ + public class ComponentBindingModel : IComponentModel + { + public string ComponentName { get; set; } = string.Empty; + + public double Cost { get; set; } + + public int Id { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..9022854 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Models; +using AbstractSoftwareInstallationDataModels.Enums; + +namespace AbstractSofrwareInstallationContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int PackageId { get; set; } + + public int Count { get; set; } + + public double Sum { get; set; } + + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + public DateTime DateCreate { get; set; } = DateTime.Now; + + public DateTime? DateImplement { get; set; } + + public int Id { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs new file mode 100644 index 0000000..68ac9fb --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Models; + +namespace AbstractSofrwareInstallationContracts.BindingModels +{ + public class PackageBindingModel : IPackageModel + { + public string PackageName { get; set; } = string.Empty; + + public double Price { get; set; } + + public Dictionary PackageComponents { get; set; } = new(); + + public int Id { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs new file mode 100644 index 0000000..669c791 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +{ + public interface IComponentLogic + { + List? ReadList(ComponentSearchModel? model); + ComponentViewModel? ReadElement(ComponentSearchModel model); + bool Create(ComponentBindingModel model); + bool Update(ComponentBindingModel model); + bool Delete(ComponentBindingModel model); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs new file mode 100644 index 0000000..bb0bb61 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + bool CreateOrder(OrderBindingModel model); + bool TakeOrderInWork(OrderBindingModel model); + bool FinishOrder(OrderBindingModel model); + bool DeliveryOrder(OrderBindingModel model); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs new file mode 100644 index 0000000..031c33f --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +{ + public interface IPackageLogic + { + List? ReadList(PackageSearchModel? model); + PackageViewModel? ReadElement(PackageSearchModel model); + bool Create(PackageBindingModel model); + bool Update(PackageBindingModel model); + bool Delete(PackageBindingModel model); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs new file mode 100644 index 0000000..e350e90 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSofrwareInstallationContracts.SearchModels +{ + public class ComponentSearchModel + { + public int? Id { get; set; } + public string? ComponentName { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..2d26d68 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSofrwareInstallationContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs new file mode 100644 index 0000000..38d81b0 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSofrwareInstallationContracts.SearchModels +{ + public class PackageSearchModel + { + public int? Id { get; set; } + public string? PackageName { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs new file mode 100644 index 0000000..79abead --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.StoragesContracts +{ + public interface IComponentStorage + { + List GetFullList(); + List GetFilteredList(ComponentSearchModel model); + ComponentViewModel? GetElement(ComponentSearchModel model); + ComponentViewModel? Insert(ComponentBindingModel model); + ComponentViewModel? Update(ComponentBindingModel model); + ComponentViewModel? Delete(ComponentBindingModel model); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs new file mode 100644 index 0000000..37ef00f --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.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); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs new file mode 100644 index 0000000..8b212b5 --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; + +namespace AbstractSofrwareInstallationContracts.StoragesContracts +{ + public interface IPackageStorage + { + List GetFullList(); + List GetFilteredList(PackageSearchModel model); + PackageViewModel? GetElement(PackageSearchModel model); + PackageViewModel? Insert(PackageBindingModel model); + PackageViewModel? Update(PackageBindingModel model); + PackageViewModel? Delete(PackageBindingModel model); + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs new file mode 100644 index 0000000..818b96f --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Models; +using System.ComponentModel; + +namespace AbstractSofrwareInstallationContracts.ViewModels +{ + public class ComponentViewModel : IComponentModel + { + public int Id { get; set; } + + [DisplayName("Название компонента")] + public string ComponentName { get; set; } = string.Empty; + + [DisplayName("Цена")] + public double Cost { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..561b89b --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Enums; +using AbstractSoftwareInstallationDataModels.Models; +using System.ComponentModel; + +namespace AbstractSofrwareInstallationContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Количество")] + public int Count { get; set; } + + [DisplayName("Сумма")] + public double Sum { get; set; } + + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + + [DisplayName("Дата выполнения")] + public DateTime? DateImplement { get; set; } + + [DisplayName("Номер")] + public int Id { get; set; } + + public int PackageId { get; set; } + } +} diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs new file mode 100644 index 0000000..e23c2ab --- /dev/null +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Models; +using System.ComponentModel; + +namespace AbstractSofrwareInstallationContracts.ViewModels +{ + public class PackageViewModel : IPackageModel + { + public int Id { get; set; } + + [DisplayName("Название изделия")] + public string PackageName { get; set; }=string.Empty; + + [DisplayName("Цена")] + public double Price { get; set; } + + public Dictionary PackageComponents { get; set; } = new(); + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj new file mode 100644 index 0000000..4dc4d8e --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj @@ -0,0 +1,38 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs new file mode 100644 index 0000000..be3d8ed --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +{ + public class ComponentLogic : IComponentLogic + { + private readonly ILogger _logger; + + private readonly IComponentStorage _componentStorage; + + public ComponentLogic(ILogger logger, IComponentStorage componentStorage) + { + _logger = logger; + _componentStorage = componentStorage; + } + + public bool Create(ComponentBindingModel model) + { + CheckModel(model); + + if (_componentStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + + return true; + } + + public bool Delete(ComponentBindingModel model) + { + CheckModel(model, false); + + _logger.LogInformation("Delete. Id:{Id}", model.Id); + + if (_componentStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + + return true; + } + + public ComponentViewModel? ReadElement(ComponentSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + _logger.LogInformation("ReadElement. ComponentName:{ComponentName}.Id:{ Id}", model.ComponentName, model.Id); + + var element = _componentStorage.GetElement(model); + + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + + return element; + } + + public List? ReadList(ComponentSearchModel? model) + { + _logger.LogInformation("ReadList. ComponentName:{ComponentName}.Id:{ Id}", model?.ComponentName, model?.Id); + + var list = model == null ? _componentStorage.GetFullList() : _componentStorage.GetFilteredList(model); + + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + + return list; + } + + public bool Update(ComponentBindingModel model) + { + CheckModel(model); + + if (_componentStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + + return true; + } + + private void CheckModel(ComponentBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (!withParams) + { + return; + } + + if (string.IsNullOrEmpty(model.ComponentName)) + { + throw new ArgumentNullException("Нет названия компонента", nameof(model.ComponentName)); + } + + if (model.Cost <= 0) + { + throw new ArgumentNullException("Цена компонента должна быть больше 0", nameof(model.Cost)); + } + + _logger.LogInformation("Component. ComponentName:{ComponentName}.Cost:{ Cost}. Id: { Id}", model.ComponentName, model.Cost, model.Id); + + var element = _componentStorage.GetElement(new ComponentSearchModel + { + ComponentName = model.ComponentName + }); + + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Компонент с таким названием уже есть"); + } + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs new file mode 100644 index 0000000..b22b746 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +{ + public class OrderLogic : IOrderLogic + { + public bool CreateOrder(OrderBindingModel model) + { + throw new NotImplementedException(); + } + + public bool DeliveryOrder(OrderBindingModel model) + { + throw new NotImplementedException(); + } + + public bool FinishOrder(OrderBindingModel model) + { + throw new NotImplementedException(); + } + + public List? ReadList(OrderSearchModel? model) + { + throw new NotImplementedException(); + } + + public bool TakeOrderInWork(OrderBindingModel model) + { + throw new NotImplementedException(); + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs new file mode 100644 index 0000000..4e96ce5 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +{ + public class PackageLogic : IPackageLogic + { + private readonly ILogger _logger; + + private readonly IPackageStorage _packageStorage; + + public PackageLogic(ILogger logger, IPackageStorage packageStorage) + { + _logger = logger; + _packageStorage = packageStorage; + } + + public bool Create(PackageBindingModel model) + { + CheckModel(model); + + if (_packageStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + + return true; + } + + public bool Delete(PackageBindingModel model) + { + CheckModel(model, false); + + _logger.LogInformation("Delete. Id:{Id}", model.Id); + + if (_packageStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + + return true; + } + + public PackageViewModel? ReadElement(PackageSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + _logger.LogInformation("ReadElement. PackageName:{PackageName}.Id:{ Id}", model.PackageName, model.Id); + + var element = _packageStorage.GetElement(model); + + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + + return element; + } + + public List? ReadList(PackageSearchModel? model) + { + _logger.LogInformation("ReadList. PackageName:{PackageName}.Id:{ Id}", model?.PackageName, model?.Id); + + var list = model == null ? _packageStorage.GetFullList() : _packageStorage.GetFilteredList(model); + + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + + return list; + } + + public bool Update(PackageBindingModel model) + { + CheckModel(model); + + if (_packageStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + + return true; + } + + private void CheckModel(PackageBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (!withParams) + { + return; + } + + if (string.IsNullOrEmpty(model.PackageName)) + { + throw new ArgumentNullException("Нет названия изделия", nameof(model.PackageName)); + } + + if (model.Price <= 0) + { + throw new ArgumentNullException("Цена изделия должна быть больше 0", nameof(model.Price)); + } + + _logger.LogInformation("Package. PackageName:{PackageName}.Price:{ Cost}. Id: { Id}", model.PackageName, model.Price, model.Id); + + var element = _packageStorage.GetElement(new PackageSearchModel + { + PackageName = model.PackageName + }); + + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Изделие с таким названием уже есть"); + } + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj new file mode 100644 index 0000000..b047637 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj @@ -0,0 +1,34 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs new file mode 100644 index 0000000..ccf37ba --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSoftwareInstallationDataModels.Enums +{ + public enum OrderStatus + { + Неизвестен = -1, + Принят = 0, + Выполняется = 1, + Готов = 2, + Выдан = 3 + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs new file mode 100644 index 0000000..661747b --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSoftwareInstallationDataModels +{ + public interface IId + { + int Id { get; } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs new file mode 100644 index 0000000..f5478c6 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSoftwareInstallationDataModels.Models +{ + public interface IComponentModel : IId + { + string ComponentName { get; } + double Cost { get; } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs new file mode 100644 index 0000000..73057e9 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationDataModels.Enums; + +namespace AbstractSoftwareInstallationDataModels.Models +{ + public interface IOrderModel : IId + { + int PackageId { get; } + int Count { get; } + double Sum { get; } + OrderStatus Status { get; } + DateTime DateCreate { get; } + DateTime? DateImplement { get; } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs new file mode 100644 index 0000000..3c3f2ac --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractSoftwareInstallationDataModels.Models +{ + public interface IPackageModel : IId + { + string PackageName { get; } + double Price { get; } + Dictionary PackageComponents { get; } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj new file mode 100644 index 0000000..8492836 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs new file mode 100644 index 0000000..c04b520 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSoftwareInstallationListImplement.Models; + +namespace AbstractSoftwareInstallationListImplement +{ + public class DataListSingleton + { + private static DataListSingleton? _instance; + public List Components { get; set; } + public List Orders { get; set; } + public List Packages { get; set; } + + private DataListSingleton() + { + Components = new List(); + Orders = new List(); + Packages = new List(); + } + + public static DataListSingleton GetInstance() + { + if (_instance == null) + { + _instance = new DataListSingleton(); + } + return _instance; + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs new file mode 100644 index 0000000..ac7dca8 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationListImplement.Models; + +namespace AbstractSoftwareInstallationListImplement.Implements +{ + public class ComponentStorage : IComponentStorage + { + private readonly DataListSingleton _source; + public ComponentStorage() + { + _source = DataListSingleton.GetInstance(); + } + public ComponentViewModel? Delete(ComponentBindingModel model) + { + for (int i = 0; i < _source.Components.Count; ++i) + { + if (_source.Components[i].Id == model.Id) + { + var element = _source.Components[i]; + _source.Components.RemoveAt(i); + return element.GetViewModel; + } + } + + return null; + } + + public ComponentViewModel? GetElement(ComponentSearchModel model) + { + if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue) + { + return null; + } + + foreach (var component in _source.Components) + { + if ((!string.IsNullOrEmpty(model.ComponentName) && component.ComponentName == model.ComponentName) || (model.Id.HasValue && component.Id == model.Id)) + { + return component.GetViewModel; + } + } + + return null; + } + + public List GetFilteredList(ComponentSearchModel model) + { + var result = new List(); + + if (string.IsNullOrEmpty(model.ComponentName)) + { + return result; + } + + foreach (var component in _source.Components) + { + if (component.ComponentName.Contains(model.ComponentName)) + { + result.Add(component.GetViewModel); + } + } + + return result; + } + + public List GetFullList() + { + var result = new List(); + + foreach (var component in _source.Components) + { + result.Add(component.GetViewModel); + } + + return result; + } + + public ComponentViewModel? Insert(ComponentBindingModel model) + { + model.Id = 1; + + foreach (var component in _source.Components) + { + if (model.Id <= component.Id) + { + model.Id = component.Id + 1; + } + } + + var newComponent = Component.Create(model); + + if (newComponent == null) + { + return null; + } + + _source.Components.Add(newComponent); + + return newComponent.GetViewModel; + } + + public ComponentViewModel? Update(ComponentBindingModel model) + { + foreach (var component in _source.Components) + { + if (component.Id == model.Id) + { + component.Update(model); + return component.GetViewModel; + } + } + + return null; + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs new file mode 100644 index 0000000..15e4438 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationListImplement.Models; + +namespace AbstractSoftwareInstallationListImplement.Implements +{ + public class OrderStorage : IOrderStorage + { + private readonly DataListSingleton _source; + public OrderStorage() + { + _source = DataListSingleton.GetInstance(); + } + public OrderViewModel? Delete(OrderBindingModel model) + { + for (int i = 0; i < _source.Orders.Count; ++i) + { + if (_source.Orders[i].Id == model.Id) + { + var element = _source.Orders[i]; + _source.Orders.RemoveAt(i); + return element.GetViewModel; + } + } + + return null; + } + + public OrderViewModel? GetElement(OrderSearchModel model) + { + if (!model.Id.HasValue) + { + return null; + } + + foreach (var order in _source.Orders) + { + if (model.Id.HasValue && order.Id == model.Id) + { + return order.GetViewModel; + } + } + + return null; + } + + public List GetFilteredList(OrderSearchModel model) + { + var result = new List(); + + if (!model.Id.HasValue) + { + return result; + } + + foreach (var order in _source.Orders) + { + if (model.Id.HasValue && order.Id == model.Id) + { + result.Add(order.GetViewModel); + } + } + + return result; + } + + public List GetFullList() + { + var result = new List(); + + foreach (var order in _source.Orders) + { + result.Add(order.GetViewModel); + } + + return result; + } + + public OrderViewModel? Insert(OrderBindingModel model) + { + model.Id = 1; + + foreach (var order in _source.Orders) + { + if (model.Id <= order.Id) + { + model.Id = order.Id + 1; + } + } + + var newOrder = Order.Create(model); + + if (newOrder == null) + { + return null; + } + + _source.Orders.Add(newOrder); + + return newOrder.GetViewModel; + } + + public OrderViewModel? Update(OrderBindingModel model) + { + foreach (var order in _source.Orders) + { + if (order.Id == model.Id) + { + order.Update(model); + return order.GetViewModel; + } + } + + return null; + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs new file mode 100644 index 0000000..d0be364 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.StoragesContracts; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.SearchModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationListImplement.Models; + +namespace AbstractSoftwareInstallationListImplement.Implements +{ + public class PackageStorage : IPackageStorage + { + private readonly DataListSingleton _source; + + public PackageStorage() + { + _source = DataListSingleton.GetInstance(); + } + + public PackageViewModel? Delete(PackageBindingModel model) + { + for (int i = 0; i < _source.Packages.Count; ++i) + { + if (_source.Packages[i].Id == model.Id) + { + var element = _source.Packages[i]; + _source.Packages.RemoveAt(i); + return element.GetViewModel; + } + } + + return null; + } + + public PackageViewModel? GetElement(PackageSearchModel model) + { + if (string.IsNullOrEmpty(model.PackageName) && !model.Id.HasValue) + { + return null; + } + + foreach (var package in _source.Packages) + { + if ((!string.IsNullOrEmpty(model.PackageName) && package.PackageName == model.PackageName) || (model.Id.HasValue && package.Id == model.Id)) + { + return package.GetViewModel; + } + } + + return null; + } + + public List GetFilteredList(PackageSearchModel model) + { + var result = new List(); + + if (string.IsNullOrEmpty(model.PackageName)) + { + return result; + } + + foreach (var package in _source.Packages) + { + if (package.PackageName.Contains(model.PackageName)) + { + result.Add(package.GetViewModel); + } + } + + return result; + } + + public List GetFullList() + { + var result = new List(); + + foreach (var package in _source.Packages) + { + result.Add(package.GetViewModel); + } + + return result; + } + + public PackageViewModel? Insert(PackageBindingModel model) + { + model.Id = 1; + + foreach (var package in _source.Packages) + { + if (model.Id <= package.Id) + { + model.Id = package.Id + 1; + } + } + + var newPackage = Package.Create(model); + + if (newPackage == null) + { + return null; + } + + _source.Packages.Add(newPackage); + + return newPackage.GetViewModel; + } + + public PackageViewModel? Update(PackageBindingModel model) + { + foreach (var package in _source.Packages) + { + if (package.Id == model.Id) + { + package.Update(model); + return package.GetViewModel; + } + } + + return null; + } + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs new file mode 100644 index 0000000..81806b7 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationDataModels.Models; + +namespace AbstractSoftwareInstallationListImplement.Models +{ + public class Component : IComponentModel + { + public string ComponentName { get; private set; } = string.Empty; + + public double Cost { get; set; } + + public int Id { get; private set; } + + public static Component? Create(ComponentBindingModel? model) + { + if (model == null) + { + return null; + } + return new Component() + { + Id = model.Id, + ComponentName = model.ComponentName, + Cost = model.Cost + }; + } + + public void Update(ComponentBindingModel? model) + { + if (model == null) + { + return; + } + ComponentName= model.ComponentName; + Cost= model.Cost; + } + + public ComponentViewModel GetViewModel => new() + { + Id = Id, + ComponentName = ComponentName, + Cost = Cost + }; + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs new file mode 100644 index 0000000..fecc3d5 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationDataModels.Enums; +using AbstractSoftwareInstallationDataModels.Models; + +namespace AbstractSoftwareInstallationListImplement.Models +{ + public class Order : IOrderModel + { + public int PackageId { get; private set; } + + public int Count { get; private set; } + + public double Sum { get; private set; } + + public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; + + public DateTime DateCreate { get; private set; } = DateTime.Now; + + public DateTime? DateImplement { get; private set; } + + public int Id { get; private set; } + + public static Order? Create(OrderBindingModel? model) + { + if (model == null) + { + return null; + } + return new Order() + { + Id = model.Id, + PackageId = model.PackageId, + Count = model.Count, + Sum=model.Sum, + Status = model.Status, + DateCreate = model.DateCreate, + DateImplement = model.DateImplement + }; + } + + public void Update(OrderBindingModel? model) + { + if (model == null) + { + return; + } + PackageId = model.PackageId; + Count = model.Count; + Sum = model.Sum; + Status = model.Status; + DateCreate = model.DateCreate; + DateImplement = model.DateImplement; + } + + public OrderViewModel GetViewModel => new() + { + Id = Id, + PackageId = PackageId, + Count = Count, + Sum = Sum, + Status = Status, + DateCreate = DateCreate, + DateImplement = DateImplement + }; + } +} diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs new file mode 100644 index 0000000..e9eb8d2 --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AbstractSofrwareInstallationContracts.BindingModels; +using AbstractSofrwareInstallationContracts.ViewModels; +using AbstractSoftwareInstallationDataModels.Models; + +namespace AbstractSoftwareInstallationListImplement.Models +{ + public class Package : IPackageModel + { + public string PackageName { get; private set; } = string.Empty; + + public double Price { get; private set; } + + public Dictionary PackageComponents { get; private set; } = new Dictionary(); + + public int Id { get; private set; } + + public static Package? Create(PackageBindingModel? model) + { + if (model == null) + { + return null; + } + return new Package() + { + Id = model.Id, + PackageName = model.PackageName, + Price = model.Price, + PackageComponents = model.PackageComponents + }; + } + + public void Update(PackageBindingModel? model) + { + if (model == null) + { + return; + } + PackageName = model.PackageName; + Price = model.Price; + PackageComponents = model.PackageComponents; + } + + public PackageViewModel GetViewModel => new() + { + Id = Id, + PackageName = PackageName, + Price = Price, + PackageComponents = PackageComponents + }; + } +} diff --git a/SoftwareInstallation/SoftwareInstallation.sln b/SoftwareInstallation/SoftwareInstallation.sln index 37ab293..0d73945 100644 --- a/SoftwareInstallation/SoftwareInstallation.sln +++ b/SoftwareInstallation/SoftwareInstallation.sln @@ -3,7 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallation", "SoftwareInstallation\SoftwareInstallation.csproj", "{4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallation", "SoftwareInstallation\SoftwareInstallation.csproj", "{4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationDataModels", "AbstractSoftwareInstallationDataModels\AbstractSoftwareInstallationDataModels.csproj", "{FF4F8531-C712-400C-8F0E-D74867ACF0A3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSofrwareInstallationContracts", "AbstractSofrwareInstallationContracts\AbstractSofrwareInstallationContracts.csproj", "{58522156-D91F-4693-8EFC-7D47464FC4CE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationBusinessLogic", "AbstractSoftwareInstallationBusinessLogic\AbstractSoftwareInstallationBusinessLogic.csproj", "{B159A640-39C5-4778-81B9-E6956009E8E0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationListImplement", "AbstractSoftwareInstallationListImplement\AbstractSoftwareInstallationListImplement.csproj", "{135DD9F6-73CE-4419-BA17-FE9E3262E0AE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +23,22 @@ Global {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Release|Any CPU.Build.0 = Release|Any CPU + {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Release|Any CPU.Build.0 = Release|Any CPU + {58522156-D91F-4693-8EFC-7D47464FC4CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58522156-D91F-4693-8EFC-7D47464FC4CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58522156-D91F-4693-8EFC-7D47464FC4CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58522156-D91F-4693-8EFC-7D47464FC4CE}.Release|Any CPU.Build.0 = Release|Any CPU + {B159A640-39C5-4778-81B9-E6956009E8E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B159A640-39C5-4778-81B9-E6956009E8E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B159A640-39C5-4778-81B9-E6956009E8E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B159A640-39C5-4778-81B9-E6956009E8E0}.Release|Any CPU.Build.0 = Release|Any CPU + {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj index b57c89e..5b1179d 100644 --- a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj +++ b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj @@ -8,4 +8,29 @@ enable + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.25.1 From be276137565369f4fbe6a384c5d16917c66733d3 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 14:48:39 +0400 Subject: [PATCH 02/12] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ComponentBindingModel.cs | 4 +- .../BindingModels/OrderBindingModel.cs | 6 +- .../BindingModels/PackageBindingModel.cs | 4 +- .../IComponentLogic.cs | 8 +- .../BusinessLogicsContracts/IOrderLogic.cs | 8 +- .../BusinessLogicsContracts/IPackageLogic.cs | 8 +- .../SearchModels/ComponentSearchModel.cs | 2 +- .../SearchModels/OrderSearchModel.cs | 2 +- .../SearchModels/PackageSearchModel.cs | 2 +- ...j => SofrwareInstallationContracts.csproj} | 2 +- .../StoragesContracts/IComponentStorage.cs | 8 +- .../StoragesContracts/IOrderStorage.cs | 8 +- .../StoragesContracts/IPackageStorage.cs | 8 +- .../ViewModels/ComponentViewModel.cs | 4 +- .../ViewModels/OrderViewModel.cs | 6 +- .../ViewModels/PackageViewModel.cs | 4 +- .../BusinessLogic/ComponentLogic.cs | 12 +- .../BusinessLogic/OrderLogic.cs | 12 +- .../BusinessLogic/PackageLogic.cs | 12 +- ... SoftwareInstallationBusinessLogic.csproj} | 2 +- .../Enums/OrderStatus.cs | 2 +- .../IId.cs | 2 +- .../Models/IComponentModel.cs | 2 +- .../Models/IOrderModel.cs | 4 +- .../Models/IPackageModel.cs | 2 +- ... => SoftwareInstallationDataModels.csproj} | 0 .../DataListSingleton.cs | 4 +- .../Implements/ComponentStorage.cs | 12 +- .../Implements/OrderStorage.cs | 12 +- .../Implements/PackageStorage.cs | 12 +- .../Models/Component.cs | 8 +- .../Models/Order.cs | 10 +- .../Models/Package.cs | 8 +- ... SoftwareInstallationListImplement.csproj} | 4 +- .../AbstractSoftwareInstallationView.csproj | 9 ++ SoftwareInstallation/SoftwareInstallation.sln | 10 +- .../SoftwareInstallation/Form1.Designer.cs | 39 ------ .../SoftwareInstallation/Form1.cs | 10 -- .../SoftwareInstallation/Form1.resx | 120 ------------------ .../FormComponent.Designer.cs | 118 +++++++++++++++++ .../SoftwareInstallation/FormComponent.cs | 102 +++++++++++++++ .../SoftwareInstallation/FormComponent.resx | 60 +++++++++ .../FormComponents.Designer.cs | 61 +++++++++ .../SoftwareInstallation/FormComponents.cs | 20 +++ .../SoftwareInstallation/FormComponents.resx | 60 +++++++++ .../SoftwareInstallation/Program.cs | 4 +- .../Properties/launchSettings.json | 7 + ...csproj => SoftwareInstallationView.csproj} | 4 + 48 files changed, 551 insertions(+), 277 deletions(-) rename SoftwareInstallation/AbstractSofrwareInstallationContracts/{AbstractSofrwareInstallationContracts.csproj => SofrwareInstallationContracts.csproj} (97%) rename SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/{AbstractSoftwareInstallationBusinessLogic.csproj => SoftwareInstallationBusinessLogic.csproj} (97%) rename SoftwareInstallation/AbstractSoftwareInstallationDataModels/{AbstractSoftwareInstallationDataModels.csproj => SoftwareInstallationDataModels.csproj} (100%) rename SoftwareInstallation/AbstractSoftwareInstallationListImplement/{AbstractSoftwareInstallationListImplement.csproj => SoftwareInstallationListImplement.csproj} (75%) create mode 100644 SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj delete mode 100644 SoftwareInstallation/SoftwareInstallation/Form1.Designer.cs delete mode 100644 SoftwareInstallation/SoftwareInstallation/Form1.cs delete mode 100644 SoftwareInstallation/SoftwareInstallation/Form1.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponent.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponent.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponents.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormComponents.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/Properties/launchSettings.json rename SoftwareInstallation/SoftwareInstallation/{SoftwareInstallation.csproj => SoftwareInstallationView.csproj} (93%) diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs index 1cc1f5d..8d77a7d 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; -namespace AbstractSofrwareInstallationContracts.BindingModels +namespace SofrwareInstallationContracts.BindingModels { public class ComponentBindingModel : IComponentModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs index 9022854..6a84f1b 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Models; -using AbstractSoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Enums; -namespace AbstractSofrwareInstallationContracts.BindingModels +namespace SofrwareInstallationContracts.BindingModels { public class OrderBindingModel : IOrderModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs index 68ac9fb..a4bff75 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; -namespace AbstractSofrwareInstallationContracts.BindingModels +namespace SofrwareInstallationContracts.BindingModels { public class PackageBindingModel : IPackageModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs index 669c791..f469e51 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +namespace SofrwareInstallationContracts.BusinessLogicsContracts { public interface IComponentLogic { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs index bb0bb61..438a365 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +namespace SofrwareInstallationContracts.BusinessLogicsContracts { public interface IOrderLogic { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs index 031c33f..73acc0c 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.BusinessLogicsContracts +namespace SofrwareInstallationContracts.BusinessLogicsContracts { public interface IPackageLogic { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs index e350e90..56c891a 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class ComponentSearchModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs index 2d26d68..470ed6e 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class OrderSearchModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs index 38d81b0..f8484e3 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class PackageSearchModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SofrwareInstallationContracts.csproj similarity index 97% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj rename to SoftwareInstallation/AbstractSofrwareInstallationContracts/SofrwareInstallationContracts.csproj index 9124162..4ed0801 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/AbstractSofrwareInstallationContracts.csproj +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/SofrwareInstallationContracts.csproj @@ -32,7 +32,7 @@ - + diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs index 79abead..9395f8a 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.StoragesContracts +namespace SofrwareInstallationContracts.StoragesContracts { public interface IComponentStorage { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs index 37ef00f..057fbf3 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.StoragesContracts +namespace SofrwareInstallationContracts.StoragesContracts { public interface IOrderStorage { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs index 8b212b5..fa07a03 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; -namespace AbstractSofrwareInstallationContracts.StoragesContracts +namespace SofrwareInstallationContracts.StoragesContracts { public interface IPackageStorage { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs index 818b96f..0c89e77 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; using System.ComponentModel; -namespace AbstractSofrwareInstallationContracts.ViewModels +namespace SofrwareInstallationContracts.ViewModels { public class ComponentViewModel : IComponentModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs index 561b89b..b9c46be 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Enums; -using AbstractSoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Models; using System.ComponentModel; -namespace AbstractSofrwareInstallationContracts.ViewModels +namespace SofrwareInstallationContracts.ViewModels { public class OrderViewModel : IOrderModel { diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs index e23c2ab..fb6d599 100644 --- a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs +++ b/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; using System.ComponentModel; -namespace AbstractSofrwareInstallationContracts.ViewModels +namespace SofrwareInstallationContracts.ViewModels { public class PackageViewModel : IPackageModel { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs index be3d8ed..280d347 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.ViewModels; using Microsoft.Extensions.Logging; -namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +namespace SoftwareInstallationBusinessLogic.BusinessLogic { public class ComponentLogic : IComponentLogic { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs index b22b746..40aef69 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.ViewModels; using Microsoft.Extensions.Logging; -namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +namespace SoftwareInstallationBusinessLogic.BusinessLogic { public class OrderLogic : IOrderLogic { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs index 4e96ce5..e9ee272 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.BusinessLogicsContracts; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.ViewModels; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.ViewModels; using Microsoft.Extensions.Logging; -namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic +namespace SoftwareInstallationBusinessLogic.BusinessLogic { public class PackageLogic : IPackageLogic { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj similarity index 97% rename from SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj rename to SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj index 4dc4d8e..eb6364d 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/AbstractSoftwareInstallationBusinessLogic.csproj +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj @@ -32,7 +32,7 @@ - + diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs index ccf37ba..f83f095 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSoftwareInstallationDataModels.Enums +namespace SoftwareInstallationDataModels.Enums { public enum OrderStatus { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs index 661747b..4c444f5 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSoftwareInstallationDataModels +namespace SoftwareInstallationDataModels { public interface IId { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs index f5478c6..685e812 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSoftwareInstallationDataModels.Models +namespace SoftwareInstallationDataModels.Models { public interface IComponentModel : IId { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs index 73057e9..a02d9a6 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Enums; -namespace AbstractSoftwareInstallationDataModels.Models +namespace SoftwareInstallationDataModels.Models { public interface IOrderModel : IId { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs index 3c3f2ac..2422691 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace AbstractSoftwareInstallationDataModels.Models +namespace SoftwareInstallationDataModels.Models { public interface IPackageModel : IId { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj b/SoftwareInstallation/AbstractSoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/AbstractSoftwareInstallationDataModels.csproj rename to SoftwareInstallation/AbstractSoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs index c04b520..051fc2c 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSoftwareInstallationListImplement.Models; +using SoftwareInstallationListImplement.Models; -namespace AbstractSoftwareInstallationListImplement +namespace SoftwareInstallationListImplement { public class DataListSingleton { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs index ac7dca8..954b1d1 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs @@ -3,13 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationListImplement.Models; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationListImplement.Models; -namespace AbstractSoftwareInstallationListImplement.Implements +namespace SoftwareInstallationListImplement.Implements { public class ComponentStorage : IComponentStorage { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs index 15e4438..efb4dd7 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs @@ -3,13 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationListImplement.Models; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationListImplement.Models; -namespace AbstractSoftwareInstallationListImplement.Implements +namespace SoftwareInstallationListImplement.Implements { public class OrderStorage : IOrderStorage { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs index d0be364..ab5e15e 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs @@ -3,13 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.StoragesContracts; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.SearchModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationListImplement.Models; +using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationListImplement.Models; -namespace AbstractSoftwareInstallationListImplement.Implements +namespace SoftwareInstallationListImplement.Implements { public class PackageStorage : IPackageStorage { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs index 81806b7..b4b1801 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationDataModels.Models; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Models; -namespace AbstractSoftwareInstallationListImplement.Models +namespace SoftwareInstallationListImplement.Models { public class Component : IComponentModel { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs index fecc3d5..8d3e254 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs @@ -4,12 +4,12 @@ using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationDataModels.Enums; -using AbstractSoftwareInstallationDataModels.Models; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Models; -namespace AbstractSoftwareInstallationListImplement.Models +namespace SoftwareInstallationListImplement.Models { public class Order : IOrderModel { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs index e9eb8d2..d837b90 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using AbstractSofrwareInstallationContracts.BindingModels; -using AbstractSofrwareInstallationContracts.ViewModels; -using AbstractSoftwareInstallationDataModels.Models; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Models; -namespace AbstractSoftwareInstallationListImplement.Models +namespace SoftwareInstallationListImplement.Models { public class Package : IPackageModel { diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj similarity index 75% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj rename to SoftwareInstallation/AbstractSoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj index 8492836..05dacb5 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/AbstractSoftwareInstallationListImplement.csproj +++ b/SoftwareInstallation/AbstractSoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj b/SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/SoftwareInstallation/SoftwareInstallation.sln b/SoftwareInstallation/SoftwareInstallation.sln index 0d73945..c44fcf1 100644 --- a/SoftwareInstallation/SoftwareInstallation.sln +++ b/SoftwareInstallation/SoftwareInstallation.sln @@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallation", "SoftwareInstallation\SoftwareInstallation.csproj", "{4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationView", "SoftwareInstallation\SoftwareInstallationView.csproj", "{4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationDataModels", "AbstractSoftwareInstallationDataModels\AbstractSoftwareInstallationDataModels.csproj", "{FF4F8531-C712-400C-8F0E-D74867ACF0A3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationDataModels", "AbstractSoftwareInstallationDataModels\SoftwareInstallationDataModels.csproj", "{FF4F8531-C712-400C-8F0E-D74867ACF0A3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSofrwareInstallationContracts", "AbstractSofrwareInstallationContracts\AbstractSofrwareInstallationContracts.csproj", "{58522156-D91F-4693-8EFC-7D47464FC4CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SofrwareInstallationContracts", "AbstractSofrwareInstallationContracts\SofrwareInstallationContracts.csproj", "{58522156-D91F-4693-8EFC-7D47464FC4CE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationBusinessLogic", "AbstractSoftwareInstallationBusinessLogic\AbstractSoftwareInstallationBusinessLogic.csproj", "{B159A640-39C5-4778-81B9-E6956009E8E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationBusinessLogic", "AbstractSoftwareInstallationBusinessLogic\SoftwareInstallationBusinessLogic.csproj", "{B159A640-39C5-4778-81B9-E6956009E8E0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractSoftwareInstallationListImplement", "AbstractSoftwareInstallationListImplement\AbstractSoftwareInstallationListImplement.csproj", "{135DD9F6-73CE-4419-BA17-FE9E3262E0AE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationListImplement", "AbstractSoftwareInstallationListImplement\SoftwareInstallationListImplement.csproj", "{135DD9F6-73CE-4419-BA17-FE9E3262E0AE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SoftwareInstallation/SoftwareInstallation/Form1.Designer.cs b/SoftwareInstallation/SoftwareInstallation/Form1.Designer.cs deleted file mode 100644 index 662fcdd..0000000 --- a/SoftwareInstallation/SoftwareInstallation/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace SoftwareInstallation -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Form1.cs b/SoftwareInstallation/SoftwareInstallation/Form1.cs deleted file mode 100644 index b325dd6..0000000 --- a/SoftwareInstallation/SoftwareInstallation/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SoftwareInstallation -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Form1.resx b/SoftwareInstallation/SoftwareInstallation/Form1.resx deleted file mode 100644 index 1af7de1..0000000 --- a/SoftwareInstallation/SoftwareInstallation/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs new file mode 100644 index 0000000..6380186 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs @@ -0,0 +1,118 @@ +namespace SoftwareInstallationView +{ + partial class FormComponent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.ComponentNameLabel = new System.Windows.Forms.Label(); + this.ComponentNameTextBox = new System.Windows.Forms.TextBox(); + this.CostLabel = new System.Windows.Forms.Label(); + this.CostTextBox = new System.Windows.Forms.TextBox(); + this.SaveButton = new System.Windows.Forms.Button(); + this.CancelButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // ComponentNameLabel + // + this.ComponentNameLabel.AutoSize = true; + this.ComponentNameLabel.Location = new System.Drawing.Point(19, 15); + this.ComponentNameLabel.Name = "ComponentNameLabel"; + this.ComponentNameLabel.Size = new System.Drawing.Size(65, 15); + this.ComponentNameLabel.TabIndex = 0; + this.ComponentNameLabel.Text = "Название: "; + // + // ComponentNameTextBox + // + this.ComponentNameTextBox.Location = new System.Drawing.Point(90, 12); + this.ComponentNameTextBox.Name = "ComponentNameTextBox"; + this.ComponentNameTextBox.Size = new System.Drawing.Size(209, 23); + this.ComponentNameTextBox.TabIndex = 2; + // + // CostLabel + // + this.CostLabel.AutoSize = true; + this.CostLabel.Location = new System.Drawing.Point(40, 54); + this.CostLabel.Name = "CostLabel"; + this.CostLabel.Size = new System.Drawing.Size(44, 15); + this.CostLabel.TabIndex = 3; + this.CostLabel.Text = "Цена: "; + // + // CostTextBox + // + this.CostTextBox.Location = new System.Drawing.Point(90, 51); + this.CostTextBox.Name = "CostTextBox"; + this.CostTextBox.Size = new System.Drawing.Size(209, 23); + this.CostTextBox.TabIndex = 4; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(143, 90); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(75, 23); + this.SaveButton.TabIndex = 5; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); + // + // CancelButton + // + this.CancelButton.Location = new System.Drawing.Point(224, 90); + this.CancelButton.Name = "CancelButton"; + this.CancelButton.Size = new System.Drawing.Size(75, 23); + this.CancelButton.TabIndex = 6; + this.CancelButton.Text = "Отмена"; + this.CancelButton.UseVisualStyleBackColor = true; + this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); + // + // FormComponent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(328, 125); + this.Controls.Add(this.CancelButton); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.CostTextBox); + this.Controls.Add(this.CostLabel); + this.Controls.Add(this.ComponentNameTextBox); + this.Controls.Add(this.ComponentNameLabel); + this.Name = "FormComponent"; + this.Text = "Компонент"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label ComponentNameLabel; + private TextBox ComponentNameTextBox; + private Label CostLabel; + private TextBox CostTextBox; + private Button SaveButton; + private Button CancelButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs new file mode 100644 index 0000000..891bd87 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using Microsoft.Extensions.Logging; + +namespace SoftwareInstallationView +{ + public partial class FormComponent : Form + { + private readonly ILogger _logger; + private readonly IComponentLogic _logic; + private int? _id; + public int Id { set { _id = value; } } + + public FormComponent(ILogger logger, IComponentLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormComponent_Load(object sender,EventArgs e) + { + if (_id.HasValue) + { + try + { + _logger.LogInformation("Получение компонента"); + + var view = _logic.ReadElement(new ComponentSearchModel + { + Id = _id.Value + }); + + if (view != null) + { + ComponentNameTextBox.Text = view.ComponentName; + CostTextBox.Text = view.Cost.ToString(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения компонента"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + } + + private void SaveButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(ComponentNameTextBox.Text)) + { + MessageBox.Show("Заполните название", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _logger.LogInformation("Сохранение компонента"); + + try + { + var model = new ComponentBindingModel + { + Id = _id ?? 0, + ComponentName = ComponentNameTextBox.Text, + Cost = Convert.ToDouble(CostTextBox.Text) + }; + + var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения компонента"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void CancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.resx b/SoftwareInstallation/SoftwareInstallation/FormComponent.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs new file mode 100644 index 0000000..637687b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs @@ -0,0 +1,61 @@ +namespace SoftwareInstallationView +{ + partial class FormComponents + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Location = new System.Drawing.Point(2, 0); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.Size = new System.Drawing.Size(551, 551); + this.dataGridView1.TabIndex = 0; + // + // FormComponents + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(725, 552); + this.Controls.Add(this.dataGridView1); + this.Name = "FormComponents"; + this.Text = "Компоненты"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DataGridView dataGridView1; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs new file mode 100644 index 0000000..cfb1026 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SoftwareInstallationView +{ + public partial class FormComponents : Form + { + public FormComponents() + { + InitializeComponent(); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.resx b/SoftwareInstallation/SoftwareInstallation/FormComponents.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Program.cs b/SoftwareInstallation/SoftwareInstallation/Program.cs index 4eda83e..df13930 100644 --- a/SoftwareInstallation/SoftwareInstallation/Program.cs +++ b/SoftwareInstallation/SoftwareInstallation/Program.cs @@ -1,3 +1,5 @@ +using SoftwareInstallationView; + namespace SoftwareInstallation { internal static class Program @@ -11,7 +13,7 @@ namespace SoftwareInstallation // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormComponents()); } } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Properties/launchSettings.json b/SoftwareInstallation/SoftwareInstallation/Properties/launchSettings.json new file mode 100644 index 0000000..8a978ef --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "SoftwareInstallationView": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj similarity index 93% rename from SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj rename to SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj index 5b1179d..ec277cf 100644 --- a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallation.csproj +++ b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj @@ -33,4 +33,8 @@ + + + + \ No newline at end of file -- 2.25.1 From 9a8c1a1b4569486588ceef6d45754db34ed6c525 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 14:50:46 +0400 Subject: [PATCH 03/12] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ComponentBindingModel.cs | 0 .../BindingModels/OrderBindingModel.cs | 0 .../BindingModels/PackageBindingModel.cs | 0 .../BusinessLogicsContracts/IComponentLogic.cs | 0 .../BusinessLogicsContracts/IOrderLogic.cs | 0 .../BusinessLogicsContracts/IPackageLogic.cs | 0 .../SearchModels/ComponentSearchModel.cs | 0 .../SearchModels/OrderSearchModel.cs | 0 .../SearchModels/PackageSearchModel.cs | 0 .../SofrwareInstallationContracts.csproj | 0 .../StoragesContracts/IComponentStorage.cs | 0 .../StoragesContracts/IOrderStorage.cs | 0 .../StoragesContracts/IPackageStorage.cs | 0 .../ViewModels/ComponentViewModel.cs | 0 .../ViewModels/OrderViewModel.cs | 0 .../ViewModels/PackageViewModel.cs | 0 .../BusinessLogic/ComponentLogic.cs | 0 .../BusinessLogic/OrderLogic.cs | 0 .../BusinessLogic/PackageLogic.cs | 0 .../SoftwareInstallationBusinessLogic.csproj | 0 .../Enums/OrderStatus.cs | 0 .../IId.cs | 0 .../Models/IComponentModel.cs | 0 .../Models/IOrderModel.cs | 0 .../Models/IPackageModel.cs | 0 .../SoftwareInstallationDataModels.csproj | 0 .../DataListSingleton.cs | 0 .../Implements/ComponentStorage.cs | 0 .../Implements/OrderStorage.cs | 0 .../Implements/PackageStorage.cs | 0 .../Models/Component.cs | 0 .../Models/Order.cs | 0 .../Models/Package.cs | 0 .../SoftwareInstallationListImplement.csproj | 0 .../AbstractSoftwareInstallationView.csproj | 0 35 files changed, 0 insertions(+), 0 deletions(-) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BindingModels/ComponentBindingModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BindingModels/OrderBindingModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BindingModels/PackageBindingModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BusinessLogicsContracts/IComponentLogic.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BusinessLogicsContracts/IOrderLogic.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/BusinessLogicsContracts/IPackageLogic.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/SearchModels/ComponentSearchModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/SearchModels/OrderSearchModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/SearchModels/PackageSearchModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/SofrwareInstallationContracts.csproj (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/StoragesContracts/IComponentStorage.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/StoragesContracts/IOrderStorage.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/StoragesContracts/IPackageStorage.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/ViewModels/ComponentViewModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/ViewModels/OrderViewModel.cs (100%) rename SoftwareInstallation/{AbstractSofrwareInstallationContracts => SofrwareInstallationContracts}/ViewModels/PackageViewModel.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationBusinessLogic => SoftwareInstallationBusinessLogic}/BusinessLogic/ComponentLogic.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationBusinessLogic => SoftwareInstallationBusinessLogic}/BusinessLogic/OrderLogic.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationBusinessLogic => SoftwareInstallationBusinessLogic}/BusinessLogic/PackageLogic.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationBusinessLogic => SoftwareInstallationBusinessLogic}/SoftwareInstallationBusinessLogic.csproj (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/Enums/OrderStatus.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/IId.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/Models/IComponentModel.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/Models/IOrderModel.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/Models/IPackageModel.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationDataModels => SoftwareInstallationDataModels}/SoftwareInstallationDataModels.csproj (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/DataListSingleton.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Implements/ComponentStorage.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Implements/OrderStorage.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Implements/PackageStorage.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Models/Component.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Models/Order.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/Models/Package.cs (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationListImplement => SoftwareInstallationListImplement}/SoftwareInstallationListImplement.csproj (100%) rename SoftwareInstallation/{AbstractSoftwareInstallationView => SoftwareInstallationView}/AbstractSoftwareInstallationView.csproj (100%) diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/OrderBindingModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BindingModels/PackageBindingModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs rename to SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/OrderSearchModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/SearchModels/PackageSearchModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/SofrwareInstallationContracts.csproj b/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/SofrwareInstallationContracts.csproj rename to SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs rename to SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs rename to SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs rename to SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/ComponentViewModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/OrderViewModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs diff --git a/SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSofrwareInstallationContracts/ViewModels/PackageViewModel.cs rename to SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs rename to SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs rename to SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs rename to SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj b/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj rename to SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/Enums/OrderStatus.cs rename to SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs b/SoftwareInstallation/SoftwareInstallationDataModels/IId.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/IId.cs rename to SoftwareInstallation/SoftwareInstallationDataModels/IId.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IComponentModel.cs rename to SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IOrderModel.cs rename to SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/Models/IPackageModel.cs rename to SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj b/SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj rename to SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs b/SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/DataListSingleton.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/ComponentStorage.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/OrderStorage.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Implements/PackageStorage.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Component.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Order.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/Models/Package.cs rename to SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs diff --git a/SoftwareInstallation/AbstractSoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj b/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj rename to SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj diff --git a/SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj similarity index 100% rename from SoftwareInstallation/AbstractSoftwareInstallationView/AbstractSoftwareInstallationView.csproj rename to SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj -- 2.25.1 From 0a1dd899ce4ca2b4e5091d340df9714c8bfd1926 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 15:17:47 +0400 Subject: [PATCH 04/12] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SofrwareInstallationContracts.csproj | 2 +- SoftwareInstallation/SoftwareInstallation.sln | 16 ++++++++-------- .../SoftwareInstallationView.csproj | 2 +- .../SoftwareInstallationBusinessLogic.csproj | 2 +- .../SoftwareInstallationListImplement.csproj | 4 ++-- .../AbstractSoftwareInstallationView.csproj | 9 --------- 6 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj b/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj index 4ed0801..f1230e8 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj +++ b/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj @@ -32,7 +32,7 @@ - + diff --git a/SoftwareInstallation/SoftwareInstallation.sln b/SoftwareInstallation/SoftwareInstallation.sln index c44fcf1..671abeb 100644 --- a/SoftwareInstallation/SoftwareInstallation.sln +++ b/SoftwareInstallation/SoftwareInstallation.sln @@ -5,13 +5,13 @@ VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationView", "SoftwareInstallation\SoftwareInstallationView.csproj", "{4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationDataModels", "AbstractSoftwareInstallationDataModels\SoftwareInstallationDataModels.csproj", "{FF4F8531-C712-400C-8F0E-D74867ACF0A3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SofrwareInstallationContracts", "SofrwareInstallationContracts\SofrwareInstallationContracts.csproj", "{58522156-D91F-4693-8EFC-7D47464FC4CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SofrwareInstallationContracts", "AbstractSofrwareInstallationContracts\SofrwareInstallationContracts.csproj", "{58522156-D91F-4693-8EFC-7D47464FC4CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationBusinessLogic", "SoftwareInstallationBusinessLogic\SoftwareInstallationBusinessLogic.csproj", "{B159A640-39C5-4778-81B9-E6956009E8E0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationBusinessLogic", "AbstractSoftwareInstallationBusinessLogic\SoftwareInstallationBusinessLogic.csproj", "{B159A640-39C5-4778-81B9-E6956009E8E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationListImplement", "SoftwareInstallationListImplement\SoftwareInstallationListImplement.csproj", "{135DD9F6-73CE-4419-BA17-FE9E3262E0AE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationListImplement", "AbstractSoftwareInstallationListImplement\SoftwareInstallationListImplement.csproj", "{135DD9F6-73CE-4419-BA17-FE9E3262E0AE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallationDataModels", "SoftwareInstallationDataModels\SoftwareInstallationDataModels.csproj", "{72ABCE8E-6DFD-4543-95E3-85BE26CF6C12}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +23,6 @@ Global {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FD4B54E-7826-42C3-AC7D-6DE0A0C32574}.Release|Any CPU.Build.0 = Release|Any CPU - {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF4F8531-C712-400C-8F0E-D74867ACF0A3}.Release|Any CPU.Build.0 = Release|Any CPU {58522156-D91F-4693-8EFC-7D47464FC4CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58522156-D91F-4693-8EFC-7D47464FC4CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {58522156-D91F-4693-8EFC-7D47464FC4CE}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -39,6 +35,10 @@ Global {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Debug|Any CPU.Build.0 = Debug|Any CPU {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Release|Any CPU.ActiveCfg = Release|Any CPU {135DD9F6-73CE-4419-BA17-FE9E3262E0AE}.Release|Any CPU.Build.0 = Release|Any CPU + {72ABCE8E-6DFD-4543-95E3-85BE26CF6C12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72ABCE8E-6DFD-4543-95E3-85BE26CF6C12}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72ABCE8E-6DFD-4543-95E3-85BE26CF6C12}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72ABCE8E-6DFD-4543-95E3-85BE26CF6C12}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj index ec277cf..023da90 100644 --- a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj +++ b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj @@ -34,7 +34,7 @@ - + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj b/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj index eb6364d..e90c31a 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj @@ -32,7 +32,7 @@ - + diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj b/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj index 05dacb5..fe1c43b 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj +++ b/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj deleted file mode 100644 index 132c02c..0000000 --- a/SoftwareInstallation/SoftwareInstallationView/AbstractSoftwareInstallationView.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - -- 2.25.1 From 262ec11c1c43d9878bfec8e4c4732346b033de9b Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 19:31:32 +0400 Subject: [PATCH 05/12] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D1=82=D0=B8=20=D1=84?= =?UTF-8?q?=D0=B8=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BD=D1=82(=D0=BF=D0=BE=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SofrwareInstallationContracts.csproj | 2 + .../FormComponents.Designer.cs | 72 ++++- .../SoftwareInstallation/FormComponents.cs | 104 +++++++- .../FormCreateOrder.Designer.cs | 139 ++++++++++ .../SoftwareInstallation/FormCreateOrder.cs | 137 ++++++++++ .../SoftwareInstallation/FormCreateOrder.resx | 60 +++++ .../SoftwareInstallation/FormMain.Designer.cs | 166 ++++++++++++ .../SoftwareInstallation/FormMain.cs | 182 +++++++++++++ .../SoftwareInstallation/FormMain.resx | 63 +++++ .../FormPackage.Designer.cs | 246 ++++++++++++++++++ .../SoftwareInstallation/FormPackage.cs | 238 +++++++++++++++++ .../SoftwareInstallation/FormPackage.resx | 66 +++++ .../FormPackageComponent.Designer.cs | 119 +++++++++ .../FormPackageComponent.cs | 95 +++++++ .../FormPackageComponent.resx | 60 +++++ .../FormPackages.Designer.cs | 109 ++++++++ .../SoftwareInstallation/FormPackages.cs | 119 +++++++++ .../SoftwareInstallation/FormPackages.resx | 60 +++++ .../SoftwareInstallation/Program.cs | 48 +++- .../Properties/Resources.Designer.cs | 63 +++++ .../Properties/Resources.resx | 120 +++++++++ .../SoftwareInstallationView.csproj | 19 ++ .../BusinessLogic/OrderLogic.cs | 117 ++++++++- .../SoftwareInstallationBusinessLogic.csproj | 2 + .../SoftwareInstallationDataModels.csproj | 2 + .../SoftwareInstallationListImplement.csproj | 6 + 26 files changed, 2380 insertions(+), 34 deletions(-) create mode 100644 SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormCreateOrder.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormMain.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormMain.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackage.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackage.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackageComponent.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackages.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/FormPackages.resx create mode 100644 SoftwareInstallation/SoftwareInstallation/Properties/Resources.Designer.cs create mode 100644 SoftwareInstallation/SoftwareInstallation/Properties/Resources.resx diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj b/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj index f1230e8..ae95ff3 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj +++ b/SoftwareInstallation/SofrwareInstallationContracts/SofrwareInstallationContracts.csproj @@ -22,6 +22,8 @@ + + diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs index 637687b..474528d 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs @@ -28,34 +28,82 @@ /// private void InitializeComponent() { - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.AddButton = new System.Windows.Forms.Button(); + this.ChangeButton = new System.Windows.Forms.Button(); + this.DeleteButton = new System.Windows.Forms.Button(); + this.UpdateButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); this.SuspendLayout(); // - // dataGridView1 + // DataGridView // - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView1.Location = new System.Drawing.Point(2, 0); - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.RowTemplate.Height = 25; - this.dataGridView1.Size = new System.Drawing.Size(551, 551); - this.dataGridView1.TabIndex = 0; + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Location = new System.Drawing.Point(2, 0); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(551, 551); + this.DataGridView.TabIndex = 0; + // + // AddButton + // + this.AddButton.Location = new System.Drawing.Point(571, 26); + this.AddButton.Name = "AddButton"; + this.AddButton.Size = new System.Drawing.Size(142, 45); + this.AddButton.TabIndex = 1; + this.AddButton.Text = "Добавить"; + this.AddButton.UseVisualStyleBackColor = true; + // + // ChangeButton + // + this.ChangeButton.Location = new System.Drawing.Point(571, 93); + this.ChangeButton.Name = "ChangeButton"; + this.ChangeButton.Size = new System.Drawing.Size(142, 45); + this.ChangeButton.TabIndex = 2; + this.ChangeButton.Text = "Изменить"; + this.ChangeButton.UseVisualStyleBackColor = true; + // + // DeleteButton + // + this.DeleteButton.Location = new System.Drawing.Point(571, 162); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.Size = new System.Drawing.Size(142, 45); + this.DeleteButton.TabIndex = 3; + this.DeleteButton.Text = "Удалить"; + this.DeleteButton.UseVisualStyleBackColor = true; + // + // UpdateButton + // + this.UpdateButton.Location = new System.Drawing.Point(571, 230); + this.UpdateButton.Name = "UpdateButton"; + this.UpdateButton.Size = new System.Drawing.Size(142, 45); + this.UpdateButton.TabIndex = 4; + this.UpdateButton.Text = "Обновить"; + this.UpdateButton.UseVisualStyleBackColor = true; // // FormComponents // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(725, 552); - this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.UpdateButton); + this.Controls.Add(this.DeleteButton); + this.Controls.Add(this.ChangeButton); + this.Controls.Add(this.AddButton); + this.Controls.Add(this.DataGridView); this.Name = "FormComponents"; this.Text = "Компоненты"; - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); this.ResumeLayout(false); } #endregion - private DataGridView dataGridView1; + private DataGridView DataGridView; + private Button AddButton; + private Button ChangeButton; + private Button DeleteButton; + private Button UpdateButton; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs index cfb1026..5d0f184 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponents.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs @@ -1,4 +1,7 @@ -using System; +using Microsoft.Extensions.Logging; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -12,9 +15,106 @@ namespace SoftwareInstallationView { public partial class FormComponents : Form { - public FormComponents() + private readonly ILogger _logger; + private readonly IComponentLogic _logic; + + public FormComponents(ILogger logger, IComponentLogic logic) { InitializeComponent(); + _logger = logger; + _logic = logic; } + + private void FormComponents_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + try + { + var list = _logic.ReadList(null); + + if (list != null) + { + DataGridView.DataSource = list; + DataGridView.Columns["Id"].Visible = false; + DataGridView.Columns["ComponentName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + } + + _logger.LogInformation("Загрузка компонентов"); + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки компонентов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void AddButton_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormComponent)); + + if (service is FormComponent form) + { + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + private void ChangeButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + var service = Program.ServiceProvider?.GetService(typeof(FormComponent)); + + if (service is FormComponent form) + { + form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + } + private void DeleteButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Удаление компонента"); + + try + { + if (!_logic.Delete(new ComponentBindingModel + { + Id = id + })) + { + throw new Exception("Ошибка при удалении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления компонента"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + private void UpdateButton_Click(object sender, EventArgs e) + { + LoadData(); + } + } } diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs new file mode 100644 index 0000000..920f686 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs @@ -0,0 +1,139 @@ +namespace SoftwareInstallationView +{ + partial class FormCreateOrder + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.PackageNameLabel = new System.Windows.Forms.Label(); + this.CountLabel = new System.Windows.Forms.Label(); + this.SumLabel = new System.Windows.Forms.Label(); + this.PackageComboBox = new System.Windows.Forms.ComboBox(); + this.CountTextBox = new System.Windows.Forms.TextBox(); + this.SumTextBox = new System.Windows.Forms.TextBox(); + this.CancelButton = new System.Windows.Forms.Button(); + this.SaveButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // PackageNameLabel + // + this.PackageNameLabel.AutoSize = true; + this.PackageNameLabel.Location = new System.Drawing.Point(12, 9); + this.PackageNameLabel.Name = "PackageNameLabel"; + this.PackageNameLabel.Size = new System.Drawing.Size(59, 15); + this.PackageNameLabel.TabIndex = 0; + this.PackageNameLabel.Text = "Изделие: "; + // + // CountLabel + // + this.CountLabel.AutoSize = true; + this.CountLabel.Location = new System.Drawing.Point(12, 40); + this.CountLabel.Name = "CountLabel"; + this.CountLabel.Size = new System.Drawing.Size(78, 15); + this.CountLabel.TabIndex = 1; + this.CountLabel.Text = "Количество: "; + // + // SumLabel + // + this.SumLabel.AutoSize = true; + this.SumLabel.Location = new System.Drawing.Point(12, 72); + this.SumLabel.Name = "SumLabel"; + this.SumLabel.Size = new System.Drawing.Size(51, 15); + this.SumLabel.TabIndex = 2; + this.SumLabel.Text = "Сумма: "; + // + // PackageComboBox + // + this.PackageComboBox.FormattingEnabled = true; + this.PackageComboBox.Location = new System.Drawing.Point(93, 6); + this.PackageComboBox.Name = "PackageComboBox"; + this.PackageComboBox.Size = new System.Drawing.Size(201, 23); + this.PackageComboBox.TabIndex = 3; + // + // CountTextBox + // + this.CountTextBox.Location = new System.Drawing.Point(93, 37); + this.CountTextBox.Name = "CountTextBox"; + this.CountTextBox.Size = new System.Drawing.Size(201, 23); + this.CountTextBox.TabIndex = 4; + // + // SumTextBox + // + this.SumTextBox.Location = new System.Drawing.Point(93, 69); + this.SumTextBox.Name = "SumTextBox"; + this.SumTextBox.Size = new System.Drawing.Size(201, 23); + this.SumTextBox.TabIndex = 5; + // + // CancelButton + // + this.CancelButton.Location = new System.Drawing.Point(219, 113); + this.CancelButton.Name = "CancelButton"; + this.CancelButton.Size = new System.Drawing.Size(75, 23); + this.CancelButton.TabIndex = 6; + this.CancelButton.Text = "Отменить"; + this.CancelButton.UseVisualStyleBackColor = true; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(138, 113); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(75, 23); + this.SaveButton.TabIndex = 7; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + // + // FormCreateOrder + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(309, 153); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.CancelButton); + this.Controls.Add(this.SumTextBox); + this.Controls.Add(this.CountTextBox); + this.Controls.Add(this.PackageComboBox); + this.Controls.Add(this.SumLabel); + this.Controls.Add(this.CountLabel); + this.Controls.Add(this.PackageNameLabel); + this.Name = "FormCreateOrder"; + this.Text = "Заказ"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label PackageNameLabel; + private Label CountLabel; + private Label SumLabel; + private ComboBox PackageComboBox; + private TextBox CountTextBox; + private TextBox SumTextBox; + private Button CancelButton; + private Button SaveButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs new file mode 100644 index 0000000..dc17b9b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs @@ -0,0 +1,137 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using Microsoft.Extensions.Logging; + + +namespace SoftwareInstallationView +{ + public partial class FormCreateOrder : Form + { + private readonly ILogger _logger; + private readonly IPackageLogic _logicP; + private readonly IOrderLogic _logicO; + + public FormCreateOrder(ILogger logger, IPackageLogic logicP, IOrderLogic logicO) + { + InitializeComponent(); + _logger = logger; + _logicP = logicP; + _logicO = logicO; + } + + private void FormCreateOrder_Load(object sender, EventArgs e) + { + _logger.LogInformation("Загрузка изделий для заказа"); + + try + { + var list = _logicP.ReadList(null); + if (list != null) + { + PackageComboBox.DisplayMember = "PackageName"; + PackageComboBox.ValueMember = "Id"; + PackageComboBox.DataSource = list; + PackageComboBox.SelectedItem = null; + } + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка изделий"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void CalcSum() + { + if (PackageComboBox.SelectedValue != null && !string.IsNullOrEmpty(CountTextBox.Text)) + { + try + { + int id = Convert.ToInt32(PackageComboBox.SelectedValue); + + var product = _logicP.ReadElement(new PackageSearchModel + { + Id = id + }); + + int count = Convert.ToInt32(CountTextBox.Text); + SumTextBox.Text = Math.Round(count * (product?.Price ?? 0), 2).ToString(); + _logger.LogInformation("Расчет суммы заказа"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка расчета суммы заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void CountTextBox_TextChanged(object sender, EventArgs e) + { + CalcSum(); + } + + private void PackageComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + CalcSum(); + } + + private void SaveButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(CountTextBox.Text)) + { + MessageBox.Show("Заполните поле Количество", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (PackageComboBox.SelectedValue == null) + { + MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _logger.LogInformation("Создание заказа"); + + try + { + var operationResult = _logicO.CreateOrder(new OrderBindingModel + { + PackageId = Convert.ToInt32(PackageComboBox.SelectedValue), + Count = Convert.ToInt32(CountTextBox.Text), + Sum = Convert.ToDouble(SumTextBox.Text) + }); + + if (!operationResult) + { + throw new Exception("Ошибка при создании заказа. Дополнительная информация в логах."); + } + + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void CancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.resx b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs new file mode 100644 index 0000000..6641ede --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs @@ -0,0 +1,166 @@ +namespace SoftwareInstallationView +{ + partial class FormMain + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.MenuStrip = new System.Windows.Forms.MenuStrip(); + this.СправочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ИзделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.КомпонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.CreateOrderButton = new System.Windows.Forms.Button(); + this.TakeOrderInWorkButton = new System.Windows.Forms.Button(); + this.OrderReadyButton = new System.Windows.Forms.Button(); + this.IssuedOrderButton = new System.Windows.Forms.Button(); + this.UpdateListButton = new System.Windows.Forms.Button(); + this.MenuStrip.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + this.SuspendLayout(); + // + // MenuStrip + // + this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.СправочникиToolStripMenuItem}); + this.MenuStrip.Location = new System.Drawing.Point(0, 0); + this.MenuStrip.Name = "MenuStrip"; + this.MenuStrip.Size = new System.Drawing.Size(800, 24); + this.MenuStrip.TabIndex = 0; + this.MenuStrip.Text = "menuStrip1"; + // + // СправочникиToolStripMenuItem + // + this.СправочникиToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ИзделияToolStripMenuItem, + this.КомпонентыToolStripMenuItem}); + this.СправочникиToolStripMenuItem.Name = "СправочникиToolStripMenuItem"; + this.СправочникиToolStripMenuItem.Size = new System.Drawing.Size(94, 20); + this.СправочникиToolStripMenuItem.Text = "Cправочники"; + // + // ИзделияToolStripMenuItem + // + this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem"; + this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.ИзделияToolStripMenuItem.Text = "Изделия"; + // + // КомпонентыToolStripMenuItem + // + this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; + this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.КомпонентыToolStripMenuItem.Text = "Компоненты"; + // + // DataGridView + // + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Location = new System.Drawing.Point(0, 27); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(657, 421); + this.DataGridView.TabIndex = 1; + // + // CreateOrderButton + // + this.CreateOrderButton.Location = new System.Drawing.Point(663, 27); + this.CreateOrderButton.Name = "CreateOrderButton"; + this.CreateOrderButton.Size = new System.Drawing.Size(125, 33); + this.CreateOrderButton.TabIndex = 2; + this.CreateOrderButton.Text = "Создать заказ"; + this.CreateOrderButton.UseVisualStyleBackColor = true; + // + // TakeOrderInWorkButton + // + this.TakeOrderInWorkButton.Location = new System.Drawing.Point(663, 82); + this.TakeOrderInWorkButton.Name = "TakeOrderInWorkButton"; + this.TakeOrderInWorkButton.Size = new System.Drawing.Size(125, 39); + this.TakeOrderInWorkButton.TabIndex = 3; + this.TakeOrderInWorkButton.Text = "Отдать на выполнение"; + this.TakeOrderInWorkButton.UseVisualStyleBackColor = true; + // + // OrderReadyButton + // + this.OrderReadyButton.Location = new System.Drawing.Point(663, 145); + this.OrderReadyButton.Name = "OrderReadyButton"; + this.OrderReadyButton.Size = new System.Drawing.Size(125, 33); + this.OrderReadyButton.TabIndex = 4; + this.OrderReadyButton.Text = "Заказ готов"; + this.OrderReadyButton.UseVisualStyleBackColor = true; + // + // IssuedOrderButton + // + this.IssuedOrderButton.Location = new System.Drawing.Point(663, 203); + this.IssuedOrderButton.Name = "IssuedOrderButton"; + this.IssuedOrderButton.Size = new System.Drawing.Size(125, 33); + this.IssuedOrderButton.TabIndex = 5; + this.IssuedOrderButton.Text = "Заказ выдан"; + this.IssuedOrderButton.UseVisualStyleBackColor = true; + // + // UpdateListButton + // + this.UpdateListButton.Location = new System.Drawing.Point(663, 261); + this.UpdateListButton.Name = "UpdateListButton"; + this.UpdateListButton.Size = new System.Drawing.Size(125, 33); + this.UpdateListButton.TabIndex = 6; + this.UpdateListButton.Text = "Обновить список"; + this.UpdateListButton.UseVisualStyleBackColor = true; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.UpdateListButton); + this.Controls.Add(this.IssuedOrderButton); + this.Controls.Add(this.OrderReadyButton); + this.Controls.Add(this.TakeOrderInWorkButton); + this.Controls.Add(this.CreateOrderButton); + this.Controls.Add(this.DataGridView); + this.Controls.Add(this.MenuStrip); + this.MainMenuStrip = this.MenuStrip; + this.Name = "FormMain"; + this.Text = "Установка ПО"; + this.MenuStrip.ResumeLayout(false); + this.MenuStrip.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MenuStrip MenuStrip; + private ToolStripMenuItem СправочникиToolStripMenuItem; + private ToolStripMenuItem ИзделияToolStripMenuItem; + private ToolStripMenuItem КомпонентыToolStripMenuItem; + private DataGridView DataGridView; + private Button CreateOrderButton; + private Button TakeOrderInWorkButton; + private Button OrderReadyButton; + private Button IssuedOrderButton; + private Button UpdateListButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs new file mode 100644 index 0000000..17dea0d --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -0,0 +1,182 @@ +using Microsoft.Extensions.Logging; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SoftwareInstallationView +{ + public partial class FormMain : Form + { + + private readonly ILogger _logger; + private readonly IOrderLogic _orderLogic; + + public FormMain(ILogger logger, IOrderLogic orderLogic) + { + InitializeComponent(); + _logger = logger; + _orderLogic = orderLogic; + } + + private void FormMain_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + _logger.LogInformation("Загрузка заказов"); + + try + { + var list = _orderLogic.ReadList(null); + + if (list != null) + { + DataGridView.DataSource = list; + DataGridView.Columns["PackageId"].Visible = false; + } + + _logger.LogInformation("Загрузка заказов"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки заказов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void КомпонентыToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormComponents)); + + if (service is FormComponents form) + { + form.ShowDialog(); + } + } + + private void ИзделияToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormPackages)); + + if (service is FormPackages form) + { + form.ShowDialog(); + } + } + + private void CreateOrderButton_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); + + if (service is FormCreateOrder form) + { + form.ShowDialog(); + LoadData(); + } + } + + private void TakeOrderInWorkButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id); + + try + { + var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel + { + Id = id + }); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка передачи заказа в работу"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void OrderReadyButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", id); + + try + { + var operationResult = _orderLogic.FinishOrder(new OrderBindingModel + { + Id = id + }); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка отметки о готовности заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void IssuedOrderButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id); + + try + { + var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel + { + Id = id + }); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + _logger.LogInformation("Заказ №{id} выдан", id); + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка отметки о выдачи заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void UpdateButton_Click(object sender, EventArgs e) + { + LoadData(); + } + + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.resx b/SoftwareInstallation/SoftwareInstallation/FormMain.resx new file mode 100644 index 0000000..a694815 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.resx @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs new file mode 100644 index 0000000..5454d02 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs @@ -0,0 +1,246 @@ +namespace SoftwareInstallationView +{ + partial class FormPackage + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + this.PackageNameLabel = new System.Windows.Forms.Label(); + this.PriceLabel = new System.Windows.Forms.Label(); + this.PackageNameTextBox = new System.Windows.Forms.TextBox(); + this.PriceTextBox = new System.Windows.Forms.TextBox(); + this.ComponentsGroupBox = new System.Windows.Forms.GroupBox(); + this.UpdateButton = new System.Windows.Forms.Button(); + this.DeleteButton = new System.Windows.Forms.Button(); + this.ChangeButton = new System.Windows.Forms.Button(); + this.AddButton = new System.Windows.Forms.Button(); + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ComponentNameField = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CountField = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CancelButton = new System.Windows.Forms.Button(); + this.SaveButton = new System.Windows.Forms.Button(); + this.ComponentsGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + this.SuspendLayout(); + // + // PackageNameLabel + // + this.PackageNameLabel.AutoSize = true; + this.PackageNameLabel.Location = new System.Drawing.Point(12, 9); + this.PackageNameLabel.Name = "PackageNameLabel"; + this.PackageNameLabel.Size = new System.Drawing.Size(65, 15); + this.PackageNameLabel.TabIndex = 0; + this.PackageNameLabel.Text = "Название: "; + // + // PriceLabel + // + this.PriceLabel.AutoSize = true; + this.PriceLabel.Location = new System.Drawing.Point(12, 43); + this.PriceLabel.Name = "PriceLabel"; + this.PriceLabel.Size = new System.Drawing.Size(73, 15); + this.PriceLabel.TabIndex = 1; + this.PriceLabel.Text = "Стоимость: "; + // + // PackageNameTextBox + // + this.PackageNameTextBox.Location = new System.Drawing.Point(83, 6); + this.PackageNameTextBox.Name = "PackageNameTextBox"; + this.PackageNameTextBox.Size = new System.Drawing.Size(283, 23); + this.PackageNameTextBox.TabIndex = 2; + // + // PriceTextBox + // + this.PriceTextBox.Location = new System.Drawing.Point(83, 40); + this.PriceTextBox.Name = "PriceTextBox"; + this.PriceTextBox.Size = new System.Drawing.Size(283, 23); + this.PriceTextBox.TabIndex = 3; + // + // ComponentsGroupBox + // + this.ComponentsGroupBox.Controls.Add(this.UpdateButton); + this.ComponentsGroupBox.Controls.Add(this.DeleteButton); + this.ComponentsGroupBox.Controls.Add(this.ChangeButton); + this.ComponentsGroupBox.Controls.Add(this.AddButton); + this.ComponentsGroupBox.Controls.Add(this.DataGridView); + this.ComponentsGroupBox.Location = new System.Drawing.Point(12, 80); + this.ComponentsGroupBox.Name = "ComponentsGroupBox"; + this.ComponentsGroupBox.Size = new System.Drawing.Size(722, 350); + this.ComponentsGroupBox.TabIndex = 5; + this.ComponentsGroupBox.TabStop = false; + this.ComponentsGroupBox.Text = "Компоненты"; + // + // UpdateButton + // + this.UpdateButton.Location = new System.Drawing.Point(590, 203); + this.UpdateButton.Name = "UpdateButton"; + this.UpdateButton.Size = new System.Drawing.Size(110, 38); + this.UpdateButton.TabIndex = 4; + this.UpdateButton.Text = "Обновить"; + this.UpdateButton.UseVisualStyleBackColor = true; + // + // DeleteButton + // + this.DeleteButton.Location = new System.Drawing.Point(590, 143); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.Size = new System.Drawing.Size(110, 38); + this.DeleteButton.TabIndex = 3; + this.DeleteButton.Text = "Удалить"; + this.DeleteButton.UseVisualStyleBackColor = true; + // + // ChangeButton + // + this.ChangeButton.Location = new System.Drawing.Point(590, 82); + this.ChangeButton.Name = "ChangeButton"; + this.ChangeButton.Size = new System.Drawing.Size(110, 38); + this.ChangeButton.TabIndex = 2; + this.ChangeButton.Text = "Изменить"; + this.ChangeButton.UseVisualStyleBackColor = true; + // + // AddButton + // + this.AddButton.Location = new System.Drawing.Point(590, 22); + this.AddButton.Name = "AddButton"; + this.AddButton.Size = new System.Drawing.Size(110, 38); + this.AddButton.TabIndex = 1; + this.AddButton.Text = "Добавить"; + this.AddButton.UseVisualStyleBackColor = true; + // + // DataGridView + // + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.ID, + this.ComponentNameField, + this.CountField}); + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.DataGridView.DefaultCellStyle = dataGridViewCellStyle2; + this.DataGridView.Location = new System.Drawing.Point(6, 22); + this.DataGridView.Name = "DataGridView"; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(561, 322); + this.DataGridView.TabIndex = 0; + // + // ID + // + this.ID.HeaderText = "ID"; + this.ID.Name = "ID"; + this.ID.Visible = false; + // + // ComponentNameField + // + this.ComponentNameField.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ComponentNameField.HeaderText = "Компонент"; + this.ComponentNameField.Name = "ComponentNameField"; + // + // CountField + // + this.CountField.HeaderText = "Количество"; + this.CountField.Name = "CountField"; + // + // CancelButton + // + this.CancelButton.Location = new System.Drawing.Point(602, 446); + this.CancelButton.Name = "CancelButton"; + this.CancelButton.Size = new System.Drawing.Size(110, 34); + this.CancelButton.TabIndex = 7; + this.CancelButton.Text = "Отмена"; + this.CancelButton.UseVisualStyleBackColor = true; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(486, 446); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(110, 34); + this.SaveButton.TabIndex = 8; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + // + // FormPackage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(746, 498); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.CancelButton); + this.Controls.Add(this.ComponentsGroupBox); + this.Controls.Add(this.PriceTextBox); + this.Controls.Add(this.PackageNameTextBox); + this.Controls.Add(this.PriceLabel); + this.Controls.Add(this.PackageNameLabel); + this.Name = "FormPackage"; + this.Text = "Изделие"; + this.ComponentsGroupBox.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label PackageNameLabel; + private Label PriceLabel; + private TextBox PackageNameTextBox; + private TextBox PriceTextBox; + private GroupBox ComponentsGroupBox; + private Button UpdateButton; + private Button DeleteButton; + private Button ChangeButton; + private Button AddButton; + private DataGridView DataGridView; + private DataGridViewTextBoxColumn ID; + private DataGridViewTextBoxColumn ComponentNameField; + private DataGridViewTextBoxColumn CountField; + private Button CancelButton; + private Button SaveButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs new file mode 100644 index 0000000..f763aa8 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.SearchModels; +using SoftwareInstallationDataModels.Models; +using Microsoft.Extensions.Logging; + + +namespace SoftwareInstallationView +{ + public partial class FormPackage : Form + { + private readonly ILogger _logger; + + private readonly IPackageLogic _logic; + + private int? _id; + + private Dictionary _packageComponents; + + public int Id { set { _id = value; } } + public FormPackage(ILogger logger, IPackageLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + _packageComponents = new Dictionary(); + } + private void FormPackage_Load(object sender, EventArgs e) + { + if (_id.HasValue) + { + _logger.LogInformation("Загрузка изделия"); + + try + { + var view = _logic.ReadElement(new PackageSearchModel + { + Id = _id.Value + }); + + if (view != null) + { + PackageNameTextBox.Text = view.PackageName; + PriceTextBox.Text = view.Price.ToString(); + _packageComponents = view.PackageComponents ?? new Dictionary(); + LoadData(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки изделия"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + private void LoadData() + { + _logger.LogInformation("Загрузка компонент изделия"); + + try + { + if (_packageComponents != null) + { + DataGridView.Rows.Clear(); + foreach (var pc in _packageComponents) + { + DataGridView.Rows.Add(new object[] { pc.Key, pc.Value.Item1.ComponentName, pc.Value.Item2 }); + } + PriceTextBox.Text = CalcPrice().ToString(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки компонент изделия"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void AddButton_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormPackageComponent)); + + if (service is FormPackageComponent form) + { + if (form.ShowDialog() == DialogResult.OK) + { + if (form.ComponentModel == null) + { + return; + } + + _logger.LogInformation("Добавление нового компонента: { ComponentName} - { Count}", form.ComponentModel.ComponentName, form.Count); + + if (_packageComponents.ContainsKey(form.Id)) + { + _packageComponents[form.Id] = (form.ComponentModel, form.Count); + } + + else + { + _packageComponents.Add(form.Id, (form.ComponentModel, form.Count)); + } + + LoadData(); + } + } + } + + private void ChangeButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + var service = Program.ServiceProvider?.GetService(typeof(FormPackageComponent)); + + if (service is FormPackageComponent form) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells[0].Value); + form.Id = id; + form.Count = _packageComponents[id].Item2; + + if (form.ShowDialog() == DialogResult.OK) + { + if (form.ComponentModel == null) + { + return; + } + + _logger.LogInformation("Изменение компонента: { ComponentName} - { Count}", form.ComponentModel.ComponentName, form.Count); + _packageComponents[form.Id] = (form.ComponentModel, form.Count); + LoadData(); + } + } + } + } + + private void DeleteButtonl_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + try + { + _logger.LogInformation("Удаление компонента: { ComponentName} - { Count}", DataGridView.SelectedRows[0].Cells[1].Value); + _packageComponents?.Remove(Convert.ToInt32(DataGridView.SelectedRows[0].Cells[0].Value)); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + LoadData(); + } + } + } + + private void UpdateButton_Click(object sender, EventArgs e) + { + LoadData(); + } + + private void SaveButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(PackageNameTextBox.Text)) + { + MessageBox.Show("Заполните название", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (string.IsNullOrEmpty(PriceTextBox.Text)) + { + MessageBox.Show("Заполните цену", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (_packageComponents == null || _packageComponents.Count == 0) + { + MessageBox.Show("Заполните компоненты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _logger.LogInformation("Сохранение изделия"); + + try + { + var model = new PackageBindingModel + { + Id = _id ?? 0, + PackageName = PackageNameTextBox.Text, + Price = Convert.ToDouble(PriceTextBox.Text), + PackageComponents = _packageComponents + }; + + var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения изделия"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void CancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private double CalcPrice() + { + double price = 0; + + foreach (var elem in _packageComponents) + { + price += ((elem.Value.Item1?.Cost ?? 0) * elem.Value.Item2); + } + + return Math.Round(price * 1.1, 2); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.resx b/SoftwareInstallation/SoftwareInstallation/FormPackage.resx new file mode 100644 index 0000000..cdfd0f5 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.resx @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs new file mode 100644 index 0000000..7ff5916 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs @@ -0,0 +1,119 @@ +namespace SoftwareInstallationView +{ + partial class FormPackageComponent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.ComponentSelectLabel = new System.Windows.Forms.Label(); + this.CountLabel = new System.Windows.Forms.Label(); + this.ComponentComboBox = new System.Windows.Forms.ComboBox(); + this.CountTextBox = new System.Windows.Forms.TextBox(); + this.SaveButton = new System.Windows.Forms.Button(); + this.CancelButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // ComponentSelectLabel + // + this.ComponentSelectLabel.AutoSize = true; + this.ComponentSelectLabel.Location = new System.Drawing.Point(26, 20); + this.ComponentSelectLabel.Name = "ComponentSelectLabel"; + this.ComponentSelectLabel.Size = new System.Drawing.Size(75, 15); + this.ComponentSelectLabel.TabIndex = 0; + this.ComponentSelectLabel.Text = "Компонент: "; + // + // CountLabel + // + this.CountLabel.AutoSize = true; + this.CountLabel.Location = new System.Drawing.Point(26, 56); + this.CountLabel.Name = "CountLabel"; + this.CountLabel.Size = new System.Drawing.Size(78, 15); + this.CountLabel.TabIndex = 1; + this.CountLabel.Text = "Количество: "; + // + // ComponentComboBox + // + this.ComponentComboBox.FormattingEnabled = true; + this.ComponentComboBox.Location = new System.Drawing.Point(107, 17); + this.ComponentComboBox.Name = "ComponentComboBox"; + this.ComponentComboBox.Size = new System.Drawing.Size(190, 23); + this.ComponentComboBox.TabIndex = 2; + // + // CountTextBox + // + this.CountTextBox.Location = new System.Drawing.Point(107, 53); + this.CountTextBox.Name = "CountTextBox"; + this.CountTextBox.Size = new System.Drawing.Size(190, 23); + this.CountTextBox.TabIndex = 3; + // + // SaveButton + // + this.SaveButton.Location = new System.Drawing.Point(141, 98); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(75, 23); + this.SaveButton.TabIndex = 4; + this.SaveButton.Text = "Сохранить"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); + // + // CancelButton + // + this.CancelButton.Location = new System.Drawing.Point(222, 98); + this.CancelButton.Name = "CancelButton"; + this.CancelButton.Size = new System.Drawing.Size(75, 23); + this.CancelButton.TabIndex = 5; + this.CancelButton.Text = "Отмена"; + this.CancelButton.UseVisualStyleBackColor = true; + this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); + // + // FormPackageComponent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(337, 141); + this.Controls.Add(this.CancelButton); + this.Controls.Add(this.SaveButton); + this.Controls.Add(this.CountTextBox); + this.Controls.Add(this.ComponentComboBox); + this.Controls.Add(this.CountLabel); + this.Controls.Add(this.ComponentSelectLabel); + this.Name = "FormPackageComponent"; + this.Text = "Компонент изделия"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Label ComponentSelectLabel; + private Label CountLabel; + private ComboBox ComponentComboBox; + private TextBox CountTextBox; + private Button SaveButton; + private Button CancelButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs new file mode 100644 index 0000000..3a6ef66 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Models; + +namespace SoftwareInstallationView +{ + public partial class FormPackageComponent : Form + { + private readonly List? _list; + + public int Id + { + get + { + return Convert.ToInt32(ComponentComboBox.SelectedValue); + } + set + { + ComponentComboBox.SelectedValue = value; + } + } + + public IComponentModel? ComponentModel + { + get + { + if (_list == null) + { + return null; + } + foreach (var elem in _list) + { + if (elem.Id == Id) + { + return elem; + } + } + return null; + } + } + + public int Count + { + get { return Convert.ToInt32(CountTextBox.Text); } + set { CountTextBox.Text = value.ToString(); } + } + + public FormPackageComponent(IComponentLogic logic) + { + InitializeComponent(); + _list = logic.ReadList(null); + if (_list != null) + { + ComponentComboBox.DisplayMember = "ComponentName"; + ComponentComboBox.ValueMember = "Id"; + ComponentComboBox.DataSource = _list; + ComponentComboBox.SelectedItem = null; + } + } + + + private void SaveButton_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(CountTextBox.Text)) + { + MessageBox.Show("Заполните поле Количество", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (ComponentComboBox.SelectedValue == null) + { + MessageBox.Show("Выберите компонент", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + DialogResult = DialogResult.OK; + Close(); + } + + private void CancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.resx b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs new file mode 100644 index 0000000..624b372 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs @@ -0,0 +1,109 @@ +namespace SoftwareInstallationView +{ + partial class FormPackages + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.DataGridView = new System.Windows.Forms.DataGridView(); + this.AddButton = new System.Windows.Forms.Button(); + this.ChangeButton = new System.Windows.Forms.Button(); + this.DeleteButton = new System.Windows.Forms.Button(); + this.UpdateButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); + this.SuspendLayout(); + // + // DataGridView + // + this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.DataGridView.Location = new System.Drawing.Point(1, 1); + this.DataGridView.Name = "DataGridView"; + this.DataGridView.RowTemplate.Height = 25; + this.DataGridView.Size = new System.Drawing.Size(562, 495); + this.DataGridView.TabIndex = 0; + // + // AddButton + // + this.AddButton.Location = new System.Drawing.Point(585, 12); + this.AddButton.Name = "AddButton"; + this.AddButton.Size = new System.Drawing.Size(120, 41); + this.AddButton.TabIndex = 1; + this.AddButton.Text = "Добавить"; + this.AddButton.UseVisualStyleBackColor = true; + // + // ChangeButton + // + this.ChangeButton.Location = new System.Drawing.Point(585, 71); + this.ChangeButton.Name = "ChangeButton"; + this.ChangeButton.Size = new System.Drawing.Size(120, 41); + this.ChangeButton.TabIndex = 2; + this.ChangeButton.Text = "Изменить"; + this.ChangeButton.UseVisualStyleBackColor = true; + // + // DeleteButton + // + this.DeleteButton.Location = new System.Drawing.Point(585, 130); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.Size = new System.Drawing.Size(120, 41); + this.DeleteButton.TabIndex = 3; + this.DeleteButton.Text = "Удалить"; + this.DeleteButton.UseVisualStyleBackColor = true; + // + // UpdateButton + // + this.UpdateButton.Location = new System.Drawing.Point(585, 191); + this.UpdateButton.Name = "UpdateButton"; + this.UpdateButton.Size = new System.Drawing.Size(120, 41); + this.UpdateButton.TabIndex = 4; + this.UpdateButton.Text = "Обновить"; + this.UpdateButton.UseVisualStyleBackColor = true; + // + // FormPackages + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(717, 502); + this.Controls.Add(this.UpdateButton); + this.Controls.Add(this.DeleteButton); + this.Controls.Add(this.ChangeButton); + this.Controls.Add(this.AddButton); + this.Controls.Add(this.DataGridView); + this.Name = "FormPackages"; + this.Text = "Изделия"; + ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private DataGridView DataGridView; + private Button AddButton; + private Button ChangeButton; + private Button DeleteButton; + private Button UpdateButton; + } +} \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs new file mode 100644 index 0000000..9f7d5e8 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Microsoft.Extensions.Logging; +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BusinessLogicsContracts; + +namespace SoftwareInstallationView +{ + public partial class FormPackages : Form + { + private readonly ILogger _logger; + private readonly IPackageLogic _logic; + + public FormPackages(ILogger logger, IPackageLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormComponents_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + try + { + var list = _logic.ReadList(null); + + if (list != null) + { + DataGridView.DataSource = list; + DataGridView.Columns["Id"].Visible = false; + DataGridView.Columns["PackageName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + } + + _logger.LogInformation("Загрузка компонентов"); + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки компонентов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void AddButton_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormPackage)); + + if (service is FormPackage form) + { + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + private void ChangeButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + var service = Program.ServiceProvider?.GetService(typeof(FormPackage)); + + if (service is FormPackage form) + { + form.Id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + } + private void DeleteButton_Click(object sender, EventArgs e) + { + if (DataGridView.SelectedRows.Count == 1) + { + if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Удаление компонента"); + + try + { + if (!_logic.Delete(new PackageBindingModel + { + Id = id + })) + { + throw new Exception("Ошибка при удалении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления компонента"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + private void UpdateButton_Click(object sender, EventArgs e) + { + LoadData(); + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.resx b/SoftwareInstallation/SoftwareInstallation/FormPackages.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/Program.cs b/SoftwareInstallation/SoftwareInstallation/Program.cs index df13930..b6759a0 100644 --- a/SoftwareInstallation/SoftwareInstallation/Program.cs +++ b/SoftwareInstallation/SoftwareInstallation/Program.cs @@ -1,19 +1,51 @@ +using SoftwareInstallationBusinessLogic.BusinessLogic; +using Microsoft.Extensions.DependencyInjection; +using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.StoragesContracts; using SoftwareInstallationView; +using System.Drawing; +using SoftwareInstallationListImplement.Implements; +using Microsoft.Extensions.Logging; +using NLog.Extensions.Logging; -namespace SoftwareInstallation + +namespace SoftwareInstallationView { internal static class Program { - /// - /// The main entry point for the application. - /// + private static ServiceProvider? _serviceProvider; + public static ServiceProvider? ServiceProvider => _serviceProvider; + [STAThread] static void Main() { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new FormComponents()); + var services = new ServiceCollection(); + ConfigureServices(services); + _serviceProvider = services.BuildServiceProvider(); + Application.Run(_serviceProvider.GetRequiredService()); + } + + private static void ConfigureServices(ServiceCollection services) + { + services.AddLogging(option => + { + option.SetMinimumLevel(LogLevel.Information); + 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(); } } -} \ No newline at end of file +} diff --git a/SoftwareInstallation/SoftwareInstallation/Properties/Resources.Designer.cs b/SoftwareInstallation/SoftwareInstallation/Properties/Resources.Designer.cs new file mode 100644 index 0000000..46ddebe --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace SoftwareInstallationView.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SoftwareInstallationView.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/SoftwareInstallation/SoftwareInstallation/Properties/Resources.resx b/SoftwareInstallation/SoftwareInstallation/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallation/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj index 023da90..ae265fb 100644 --- a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj +++ b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj @@ -24,6 +24,8 @@ + + @@ -35,6 +37,23 @@ + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs index 40aef69..1e021a9 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs @@ -9,34 +9,127 @@ using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.StoragesContracts; using SofrwareInstallationContracts.ViewModels; using Microsoft.Extensions.Logging; +using SoftwareInstallationDataModels.Enums; namespace SoftwareInstallationBusinessLogic.BusinessLogic { public class OrderLogic : IOrderLogic { + private readonly ILogger _logger; + private readonly IOrderStorage _orderStorage; + + public OrderLogic(ILogger logger, IOrderStorage orderStorage) + { + _logger = logger; + _orderStorage = orderStorage; + } + public bool CreateOrder(OrderBindingModel model) { - throw new NotImplementedException(); + CheckModel(model); + + if (model.Status != OrderStatus.Неизвестен) + { + _logger.LogWarning("Insert operation failed. Order status incorrect."); + return false; + } + + model.Status = OrderStatus.Принят; + + if (_orderStorage.Insert(model) == null) + { + model.Status = OrderStatus.Неизвестен; + _logger.LogWarning("Insert operation failed"); + return false; + } + + return true; } - public bool DeliveryOrder(OrderBindingModel model) + public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus) { - throw new NotImplementedException(); - } + CheckModel(model); - public bool FinishOrder(OrderBindingModel model) - { - throw new NotImplementedException(); - } + if (model.Status + 1 != newStatus) + { + _logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Order status incorrect."); + return false; + } - public List? ReadList(OrderSearchModel? model) - { - throw new NotImplementedException(); + model.Status = newStatus; + + if (model.Status == OrderStatus.Выдан) + model.DateImplement = DateTime.Now; + + if (_orderStorage.Update(model) == null) + { + model.Status--; + _logger.LogWarning("Update operation failed"); + return false; + } + + return true; } public bool TakeOrderInWork(OrderBindingModel model) { - throw new NotImplementedException(); + return StatusUpdate(model, OrderStatus.Выполняется); + } + + public bool DeliveryOrder(OrderBindingModel model) + { + return StatusUpdate(model, OrderStatus.Готов); + } + + public bool FinishOrder(OrderBindingModel model) + { + return StatusUpdate(model, OrderStatus.Выдан); + } + + public List? ReadList(OrderSearchModel? model) + { + _logger.LogInformation("Order. OrderId:{Id}", model?.Id); + + var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model); + + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + private void CheckModel(OrderBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (!withParams) + { + return; + } + + if (model.PackageId < 0) + { + throw new ArgumentNullException("Некорректный идентификатор изделия", nameof(model.PackageId)); + } + + if (model.Count <= 0) + { + throw new ArgumentNullException("Количество изделий в заказе должно быть больше 0", nameof(model.Count)); + } + + if (model.Sum <= 0) + { + throw new ArgumentNullException("Сумма заказа должна быть больше 0", nameof(model.Sum)); + } + + _logger.LogInformation("Order. OrderId:{Id}.Sum:{ Sum}. PackageId: { PackageId}", model.Id, model.Sum, model.PackageId); } } } diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj b/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj index e90c31a..29f29c0 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/SoftwareInstallationBusinessLogic.csproj @@ -22,6 +22,8 @@ + + diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj b/SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj index b047637..c02b0d1 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj +++ b/SoftwareInstallation/SoftwareInstallationDataModels/SoftwareInstallationDataModels.csproj @@ -22,6 +22,8 @@ + + diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj b/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj index fe1c43b..6ec57b2 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj +++ b/SoftwareInstallation/SoftwareInstallationListImplement/SoftwareInstallationListImplement.csproj @@ -6,6 +6,12 @@ enable + + + + + + -- 2.25.1 From b73d15d472ae532496c6084c2fef4b140dbd64e5 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 21:16:13 +0400 Subject: [PATCH 06/12] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D1=82=D0=B8...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/OrderViewModel.cs | 3 +- .../FormComponent.Designer.cs | 22 ++--- .../SoftwareInstallation/FormComponent.cs | 2 +- .../FormComponents.Designer.cs | 4 + .../FormCreateOrder.Designer.cs | 24 +++--- .../SoftwareInstallation/FormCreateOrder.cs | 2 +- .../SoftwareInstallation/FormMain.Designer.cs | 11 ++- .../SoftwareInstallation/FormMain.cs | 25 ++++-- .../FormPackage.Designer.cs | 80 ++++++++++--------- .../SoftwareInstallation/FormPackage.cs | 4 +- .../FormPackageComponent.Designer.cs | 22 ++--- .../FormPackageComponent.cs | 2 +- .../FormPackages.Designer.cs | 4 + .../SoftwareInstallation/FormPackages.cs | 9 ++- .../SoftwareInstallation/Program.cs | 2 - 15 files changed, 128 insertions(+), 88 deletions(-) diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index b9c46be..f1e48d0 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -11,6 +11,8 @@ namespace SofrwareInstallationContracts.ViewModels { public class OrderViewModel : IOrderModel { + public int PackageId { get; set; } + [DisplayName("Количество")] public int Count { get; set; } @@ -29,6 +31,5 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Номер")] public int Id { get; set; } - public int PackageId { get; set; } } } diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs index 6380186..26effb3 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.Designer.cs @@ -33,7 +33,7 @@ this.CostLabel = new System.Windows.Forms.Label(); this.CostTextBox = new System.Windows.Forms.TextBox(); this.SaveButton = new System.Windows.Forms.Button(); - this.CancelButton = new System.Windows.Forms.Button(); + this.ButtonCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); // // ComponentNameLabel @@ -78,22 +78,22 @@ this.SaveButton.UseVisualStyleBackColor = true; this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // - // CancelButton + // ButtonCancel // - this.CancelButton.Location = new System.Drawing.Point(224, 90); - this.CancelButton.Name = "CancelButton"; - this.CancelButton.Size = new System.Drawing.Size(75, 23); - this.CancelButton.TabIndex = 6; - this.CancelButton.Text = "Отмена"; - this.CancelButton.UseVisualStyleBackColor = true; - this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); + this.ButtonCancel.Location = new System.Drawing.Point(224, 90); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(75, 23); + this.ButtonCancel.TabIndex = 6; + this.ButtonCancel.Text = "Отмена"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); // // FormComponent // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(328, 125); - this.Controls.Add(this.CancelButton); + this.Controls.Add(this.ButtonCancel); this.Controls.Add(this.SaveButton); this.Controls.Add(this.CostTextBox); this.Controls.Add(this.CostLabel); @@ -113,6 +113,6 @@ private Label CostLabel; private TextBox CostTextBox; private Button SaveButton; - private Button CancelButton; + private Button ButtonCancel; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs index 891bd87..1986d04 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponent.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs @@ -93,7 +93,7 @@ namespace SoftwareInstallationView } } - private void CancelButton_Click(object sender, EventArgs e) + private void ButtonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs index 474528d..d887a90 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.Designer.cs @@ -53,6 +53,7 @@ this.AddButton.TabIndex = 1; this.AddButton.Text = "Добавить"; this.AddButton.UseVisualStyleBackColor = true; + this.AddButton.Click += new System.EventHandler(this.AddButton_Click); // // ChangeButton // @@ -62,6 +63,7 @@ this.ChangeButton.TabIndex = 2; this.ChangeButton.Text = "Изменить"; this.ChangeButton.UseVisualStyleBackColor = true; + this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click); // // DeleteButton // @@ -71,6 +73,7 @@ this.DeleteButton.TabIndex = 3; this.DeleteButton.Text = "Удалить"; this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); // // UpdateButton // @@ -80,6 +83,7 @@ this.UpdateButton.TabIndex = 4; this.UpdateButton.Text = "Обновить"; this.UpdateButton.UseVisualStyleBackColor = true; + this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click); // // FormComponents // diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs index 920f686..efac4c9 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.Designer.cs @@ -34,7 +34,7 @@ this.PackageComboBox = new System.Windows.Forms.ComboBox(); this.CountTextBox = new System.Windows.Forms.TextBox(); this.SumTextBox = new System.Windows.Forms.TextBox(); - this.CancelButton = new System.Windows.Forms.Button(); + this.ButtonCancel = new System.Windows.Forms.Button(); this.SaveButton = new System.Windows.Forms.Button(); this.SuspendLayout(); // @@ -72,6 +72,7 @@ this.PackageComboBox.Name = "PackageComboBox"; this.PackageComboBox.Size = new System.Drawing.Size(201, 23); this.PackageComboBox.TabIndex = 3; + this.PackageComboBox.SelectedIndexChanged += new System.EventHandler(this.PackageComboBox_SelectedIndexChanged); // // CountTextBox // @@ -79,6 +80,7 @@ this.CountTextBox.Name = "CountTextBox"; this.CountTextBox.Size = new System.Drawing.Size(201, 23); this.CountTextBox.TabIndex = 4; + this.CountTextBox.TextChanged += new System.EventHandler(this.CountTextBox_TextChanged); // // SumTextBox // @@ -87,14 +89,15 @@ this.SumTextBox.Size = new System.Drawing.Size(201, 23); this.SumTextBox.TabIndex = 5; // - // CancelButton + // ButtonCancel // - this.CancelButton.Location = new System.Drawing.Point(219, 113); - this.CancelButton.Name = "CancelButton"; - this.CancelButton.Size = new System.Drawing.Size(75, 23); - this.CancelButton.TabIndex = 6; - this.CancelButton.Text = "Отменить"; - this.CancelButton.UseVisualStyleBackColor = true; + this.ButtonCancel.Location = new System.Drawing.Point(219, 113); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(75, 23); + this.ButtonCancel.TabIndex = 6; + this.ButtonCancel.Text = "Отменить"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); // // SaveButton // @@ -104,6 +107,7 @@ this.SaveButton.TabIndex = 7; this.SaveButton.Text = "Сохранить"; this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // // FormCreateOrder // @@ -111,7 +115,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(309, 153); this.Controls.Add(this.SaveButton); - this.Controls.Add(this.CancelButton); + this.Controls.Add(this.ButtonCancel); this.Controls.Add(this.SumTextBox); this.Controls.Add(this.CountTextBox); this.Controls.Add(this.PackageComboBox); @@ -133,7 +137,7 @@ private ComboBox PackageComboBox; private TextBox CountTextBox; private TextBox SumTextBox; - private Button CancelButton; + private Button ButtonCancel; private Button SaveButton; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs index dc17b9b..0a9dd7a 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs @@ -128,7 +128,7 @@ namespace SoftwareInstallationView } } - private void CancelButton_Click(object sender, EventArgs e) + private void ButtonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs index 6641ede..1a4b481 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs @@ -64,14 +64,16 @@ // ИзделияToolStripMenuItem // this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem"; - this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.ИзделияToolStripMenuItem.Text = "Изделия"; + this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click); // // КомпонентыToolStripMenuItem // this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; - this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.КомпонентыToolStripMenuItem.Text = "Компоненты"; + this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click); // // DataGridView // @@ -90,6 +92,7 @@ this.CreateOrderButton.TabIndex = 2; this.CreateOrderButton.Text = "Создать заказ"; this.CreateOrderButton.UseVisualStyleBackColor = true; + this.CreateOrderButton.Click += new System.EventHandler(this.CreateOrderButton_Click); // // TakeOrderInWorkButton // @@ -99,6 +102,7 @@ this.TakeOrderInWorkButton.TabIndex = 3; this.TakeOrderInWorkButton.Text = "Отдать на выполнение"; this.TakeOrderInWorkButton.UseVisualStyleBackColor = true; + this.TakeOrderInWorkButton.Click += new System.EventHandler(this.TakeOrderInWorkButton_Click); // // OrderReadyButton // @@ -108,6 +112,7 @@ this.OrderReadyButton.TabIndex = 4; this.OrderReadyButton.Text = "Заказ готов"; this.OrderReadyButton.UseVisualStyleBackColor = true; + this.OrderReadyButton.Click += new System.EventHandler(this.OrderReadyButton_Click); // // IssuedOrderButton // @@ -117,6 +122,7 @@ this.IssuedOrderButton.TabIndex = 5; this.IssuedOrderButton.Text = "Заказ выдан"; this.IssuedOrderButton.UseVisualStyleBackColor = true; + this.IssuedOrderButton.Click += new System.EventHandler(this.IssuedOrderButton_Click); // // UpdateListButton // @@ -126,6 +132,7 @@ this.UpdateListButton.TabIndex = 6; this.UpdateListButton.Text = "Обновить список"; this.UpdateListButton.UseVisualStyleBackColor = true; + this.UpdateListButton.Click += new System.EventHandler(this.UpdateListButton_Click); // // FormMain // diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index 17dea0d..67b89a1 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Logging; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; +using SoftwareInstallationDataModels.Enums; using System; using System.Collections.Generic; using System.ComponentModel; @@ -96,7 +97,12 @@ namespace SoftwareInstallationView { var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { - Id = id + Id = id, + PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) @@ -125,7 +131,12 @@ namespace SoftwareInstallationView { var operationResult = _orderLogic.FinishOrder(new OrderBindingModel { - Id = id + Id = id, + PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) @@ -154,7 +165,12 @@ namespace SoftwareInstallationView { var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { - Id = id + Id = id, + PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), + Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), + Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), + DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), }); if (!operationResult) @@ -173,10 +189,9 @@ namespace SoftwareInstallationView } } - private void UpdateButton_Click(object sender, EventArgs e) + private void UpdateListButton_Click(object sender, EventArgs e) { LoadData(); } - } } diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs index 5454d02..e20ba42 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs @@ -28,9 +28,9 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.PackageNameLabel = new System.Windows.Forms.Label(); this.PriceLabel = new System.Windows.Forms.Label(); this.PackageNameTextBox = new System.Windows.Forms.TextBox(); @@ -44,7 +44,7 @@ this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ComponentNameField = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.CountField = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.CancelButton = new System.Windows.Forms.Button(); + this.ButtonCancel = new System.Windows.Forms.Button(); this.SaveButton = new System.Windows.Forms.Button(); this.ComponentsGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); @@ -104,6 +104,7 @@ this.UpdateButton.TabIndex = 4; this.UpdateButton.Text = "Обновить"; this.UpdateButton.UseVisualStyleBackColor = true; + this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click); // // DeleteButton // @@ -113,6 +114,7 @@ this.DeleteButton.TabIndex = 3; this.DeleteButton.Text = "Удалить"; this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); // // ChangeButton // @@ -122,6 +124,7 @@ this.ChangeButton.TabIndex = 2; this.ChangeButton.Text = "Изменить"; this.ChangeButton.UseVisualStyleBackColor = true; + this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click); // // AddButton // @@ -131,40 +134,41 @@ this.AddButton.TabIndex = 1; this.AddButton.Text = "Добавить"; this.AddButton.UseVisualStyleBackColor = true; + this.AddButton.Click += new System.EventHandler(this.AddButton_Click); // // DataGridView // - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.ID, this.ComponentNameField, this.CountField}); - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.DataGridView.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.DataGridView.DefaultCellStyle = dataGridViewCellStyle5; this.DataGridView.Location = new System.Drawing.Point(6, 22); this.DataGridView.Name = "DataGridView"; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle6; this.DataGridView.RowTemplate.Height = 25; this.DataGridView.Size = new System.Drawing.Size(561, 322); this.DataGridView.TabIndex = 0; @@ -186,14 +190,15 @@ this.CountField.HeaderText = "Количество"; this.CountField.Name = "CountField"; // - // CancelButton + // ButtonCancel // - this.CancelButton.Location = new System.Drawing.Point(602, 446); - this.CancelButton.Name = "CancelButton"; - this.CancelButton.Size = new System.Drawing.Size(110, 34); - this.CancelButton.TabIndex = 7; - this.CancelButton.Text = "Отмена"; - this.CancelButton.UseVisualStyleBackColor = true; + this.ButtonCancel.Location = new System.Drawing.Point(602, 446); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(110, 34); + this.ButtonCancel.TabIndex = 7; + this.ButtonCancel.Text = "Отмена"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); // // SaveButton // @@ -203,6 +208,7 @@ this.SaveButton.TabIndex = 8; this.SaveButton.Text = "Сохранить"; this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // // FormPackage // @@ -210,7 +216,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(746, 498); this.Controls.Add(this.SaveButton); - this.Controls.Add(this.CancelButton); + this.Controls.Add(this.ButtonCancel); this.Controls.Add(this.ComponentsGroupBox); this.Controls.Add(this.PriceTextBox); this.Controls.Add(this.PackageNameTextBox); @@ -240,7 +246,7 @@ private DataGridViewTextBoxColumn ID; private DataGridViewTextBoxColumn ComponentNameField; private DataGridViewTextBoxColumn CountField; - private Button CancelButton; + private Button ButtonCancel; private Button SaveButton; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs index f763aa8..2899e22 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackage.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs @@ -141,7 +141,7 @@ namespace SoftwareInstallationView } } - private void DeleteButtonl_Click(object sender, EventArgs e) + private void DeleteButton_Click(object sender, EventArgs e) { if (DataGridView.SelectedRows.Count == 1) { @@ -217,7 +217,7 @@ namespace SoftwareInstallationView } } - private void CancelButton_Click(object sender, EventArgs e) + private void ButtonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs index 7ff5916..e1886fc 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.Designer.cs @@ -33,7 +33,7 @@ this.ComponentComboBox = new System.Windows.Forms.ComboBox(); this.CountTextBox = new System.Windows.Forms.TextBox(); this.SaveButton = new System.Windows.Forms.Button(); - this.CancelButton = new System.Windows.Forms.Button(); + this.ButtonCancel = new System.Windows.Forms.Button(); this.SuspendLayout(); // // ComponentSelectLabel @@ -79,22 +79,22 @@ this.SaveButton.UseVisualStyleBackColor = true; this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click); // - // CancelButton + // ButtonCancel // - this.CancelButton.Location = new System.Drawing.Point(222, 98); - this.CancelButton.Name = "CancelButton"; - this.CancelButton.Size = new System.Drawing.Size(75, 23); - this.CancelButton.TabIndex = 5; - this.CancelButton.Text = "Отмена"; - this.CancelButton.UseVisualStyleBackColor = true; - this.CancelButton.Click += new System.EventHandler(this.CancelButton_Click); + this.ButtonCancel.Location = new System.Drawing.Point(222, 98); + this.ButtonCancel.Name = "ButtonCancel"; + this.ButtonCancel.Size = new System.Drawing.Size(75, 23); + this.ButtonCancel.TabIndex = 5; + this.ButtonCancel.Text = "Отмена"; + this.ButtonCancel.UseVisualStyleBackColor = true; + this.ButtonCancel.Click += new System.EventHandler(this.ButtonCancel_Click); // // FormPackageComponent // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(337, 141); - this.Controls.Add(this.CancelButton); + this.Controls.Add(this.ButtonCancel); this.Controls.Add(this.SaveButton); this.Controls.Add(this.CountTextBox); this.Controls.Add(this.ComponentComboBox); @@ -114,6 +114,6 @@ private ComboBox ComponentComboBox; private TextBox CountTextBox; private Button SaveButton; - private Button CancelButton; + private Button ButtonCancel; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs index 3a6ef66..bcb0e2e 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs @@ -86,7 +86,7 @@ namespace SoftwareInstallationView Close(); } - private void CancelButton_Click(object sender, EventArgs e) + private void ButtonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs index 624b372..70bcb9f 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.Designer.cs @@ -53,6 +53,7 @@ this.AddButton.TabIndex = 1; this.AddButton.Text = "Добавить"; this.AddButton.UseVisualStyleBackColor = true; + this.AddButton.Click += new System.EventHandler(this.AddButton_Click); // // ChangeButton // @@ -62,6 +63,7 @@ this.ChangeButton.TabIndex = 2; this.ChangeButton.Text = "Изменить"; this.ChangeButton.UseVisualStyleBackColor = true; + this.ChangeButton.Click += new System.EventHandler(this.ChangeButton_Click); // // DeleteButton // @@ -71,6 +73,7 @@ this.DeleteButton.TabIndex = 3; this.DeleteButton.Text = "Удалить"; this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); // // UpdateButton // @@ -80,6 +83,7 @@ this.UpdateButton.TabIndex = 4; this.UpdateButton.Text = "Обновить"; this.UpdateButton.UseVisualStyleBackColor = true; + this.UpdateButton.Click += new System.EventHandler(this.UpdateButton_Click); // // FormPackages // diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs index 9f7d5e8..432b08f 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs @@ -41,14 +41,15 @@ namespace SoftwareInstallationView DataGridView.DataSource = list; DataGridView.Columns["Id"].Visible = false; DataGridView.Columns["PackageName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + DataGridView.Columns["PackageComponents"].Visible = false; } - _logger.LogInformation("Загрузка компонентов"); + _logger.LogInformation("Загрузка изделий"); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка загрузки компонентов"); + _logger.LogError(ex, "Ошибка загрузки изделий"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -89,7 +90,7 @@ namespace SoftwareInstallationView if (MessageBox.Show("Удалить запись?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { int id = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Удаление компонента"); + _logger.LogInformation("Удаление изделия"); try { @@ -105,7 +106,7 @@ namespace SoftwareInstallationView } catch (Exception ex) { - _logger.LogError(ex, "Ошибка удаления компонента"); + _logger.LogError(ex, "Ошибка удаления изделия"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } diff --git a/SoftwareInstallation/SoftwareInstallation/Program.cs b/SoftwareInstallation/SoftwareInstallation/Program.cs index b6759a0..da04f53 100644 --- a/SoftwareInstallation/SoftwareInstallation/Program.cs +++ b/SoftwareInstallation/SoftwareInstallation/Program.cs @@ -2,8 +2,6 @@ using SoftwareInstallationBusinessLogic.BusinessLogic; using Microsoft.Extensions.DependencyInjection; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.StoragesContracts; -using SoftwareInstallationView; -using System.Drawing; using SoftwareInstallationListImplement.Implements; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; -- 2.25.1 From e2b226373f0e773dd43acdd83d3551dedb3aad67 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Mon, 30 Jan 2023 21:28:23 +0400 Subject: [PATCH 07/12] =?UTF-8?q?=D0=A4=D0=B8=D0=BD=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SoftwareInstallation/FormCreateOrder.cs | 8 +++++++- SoftwareInstallation/SoftwareInstallation/FormMain.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs index 0a9dd7a..7ea18c6 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs @@ -27,9 +27,10 @@ namespace SoftwareInstallationView _logger = logger; _logicP = logicP; _logicO = logicO; + LoadData(); } - private void FormCreateOrder_Load(object sender, EventArgs e) + private void LoadData() { _logger.LogInformation("Загрузка изделий для заказа"); @@ -52,6 +53,11 @@ namespace SoftwareInstallationView } } + private void FormCreateOrder_Load(object sender, EventArgs e) + { + LoadData(); + } + private void CalcSum() { if (PackageComboBox.SelectedValue != null && !string.IsNullOrEmpty(CountTextBox.Text)) diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index 67b89a1..4c18d71 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -120,7 +120,7 @@ namespace SoftwareInstallationView } } - private void OrderReadyButton_Click(object sender, EventArgs e) + private void IssuedOrderButton_Click(object sender, EventArgs e) { if (DataGridView.SelectedRows.Count == 1) { @@ -154,7 +154,7 @@ namespace SoftwareInstallationView } } - private void IssuedOrderButton_Click(object sender, EventArgs e) + private void OrderReadyButton_Click(object sender, EventArgs e) { if (DataGridView.SelectedRows.Count == 1) { -- 2.25.1 From 495a8ca63ee42677a8cc48a6bced5685f1fe6d78 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Tue, 31 Jan 2023 00:02:48 +0400 Subject: [PATCH 08/12] =?UTF-8?q?=D0=A4=D0=B8=D0=BD=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/OrderViewModel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index f1e48d0..cf2378a 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -13,6 +13,9 @@ namespace SofrwareInstallationContracts.ViewModels { public int PackageId { get; set; } + [DisplayName("Номер")] + public int Id { get; set; } + [DisplayName("Количество")] public int Count { get; set; } @@ -28,8 +31,5 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Дата выполнения")] public DateTime? DateImplement { get; set; } - [DisplayName("Номер")] - public int Id { get; set; } - } } -- 2.25.1 From 7f72ec0ea94467929828de947e09d38fcb4c6d7b Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Tue, 31 Jan 2023 12:21:29 +0400 Subject: [PATCH 09/12] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/OrderBindingModel.cs | 1 + .../ViewModels/OrderViewModel.cs | 4 ++++ .../SoftwareInstallation/FormCreateOrder.cs | 1 + .../SoftwareInstallation/FormMain.Designer.cs | 16 ++++++++-------- .../SoftwareInstallation/FormMain.cs | 3 +++ .../SoftwareInstallation/FormMain.resx | 3 +++ .../Models/IOrderModel.cs | 1 + .../Models/Order.cs | 6 ++++++ 8 files changed, 27 insertions(+), 8 deletions(-) diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs index 6a84f1b..0d83ee0 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs @@ -23,5 +23,6 @@ namespace SofrwareInstallationContracts.BindingModels public DateTime? DateImplement { get; set; } public int Id { get; set; } + public string PackageName { get; set; } = string.Empty; } } diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index cf2378a..dcec9b6 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -16,6 +16,9 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Номер")] public int Id { get; set; } + [DisplayName("Название изделия")] + public string PackageName { get; set; } = string.Empty; + [DisplayName("Количество")] public int Count { get; set; } @@ -31,5 +34,6 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Дата выполнения")] public DateTime? DateImplement { get; set; } + } } diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs index 7ea18c6..48c9170 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs @@ -114,6 +114,7 @@ namespace SoftwareInstallationView var operationResult = _logicO.CreateOrder(new OrderBindingModel { PackageId = Convert.ToInt32(PackageComboBox.SelectedValue), + PackageName=PackageComboBox.Text, Count = Convert.ToInt32(CountTextBox.Text), Sum = Convert.ToDouble(SumTextBox.Text) }); diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs index 1a4b481..49adff0 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs @@ -48,7 +48,7 @@ this.СправочникиToolStripMenuItem}); this.MenuStrip.Location = new System.Drawing.Point(0, 0); this.MenuStrip.Name = "MenuStrip"; - this.MenuStrip.Size = new System.Drawing.Size(800, 24); + this.MenuStrip.Size = new System.Drawing.Size(865, 24); this.MenuStrip.TabIndex = 0; this.MenuStrip.Text = "menuStrip1"; // @@ -81,12 +81,12 @@ this.DataGridView.Location = new System.Drawing.Point(0, 27); this.DataGridView.Name = "DataGridView"; this.DataGridView.RowTemplate.Height = 25; - this.DataGridView.Size = new System.Drawing.Size(657, 421); + this.DataGridView.Size = new System.Drawing.Size(722, 421); this.DataGridView.TabIndex = 1; // // CreateOrderButton // - this.CreateOrderButton.Location = new System.Drawing.Point(663, 27); + this.CreateOrderButton.Location = new System.Drawing.Point(728, 28); this.CreateOrderButton.Name = "CreateOrderButton"; this.CreateOrderButton.Size = new System.Drawing.Size(125, 33); this.CreateOrderButton.TabIndex = 2; @@ -96,7 +96,7 @@ // // TakeOrderInWorkButton // - this.TakeOrderInWorkButton.Location = new System.Drawing.Point(663, 82); + this.TakeOrderInWorkButton.Location = new System.Drawing.Point(728, 83); this.TakeOrderInWorkButton.Name = "TakeOrderInWorkButton"; this.TakeOrderInWorkButton.Size = new System.Drawing.Size(125, 39); this.TakeOrderInWorkButton.TabIndex = 3; @@ -106,7 +106,7 @@ // // OrderReadyButton // - this.OrderReadyButton.Location = new System.Drawing.Point(663, 145); + this.OrderReadyButton.Location = new System.Drawing.Point(728, 146); this.OrderReadyButton.Name = "OrderReadyButton"; this.OrderReadyButton.Size = new System.Drawing.Size(125, 33); this.OrderReadyButton.TabIndex = 4; @@ -116,7 +116,7 @@ // // IssuedOrderButton // - this.IssuedOrderButton.Location = new System.Drawing.Point(663, 203); + this.IssuedOrderButton.Location = new System.Drawing.Point(728, 204); this.IssuedOrderButton.Name = "IssuedOrderButton"; this.IssuedOrderButton.Size = new System.Drawing.Size(125, 33); this.IssuedOrderButton.TabIndex = 5; @@ -126,7 +126,7 @@ // // UpdateListButton // - this.UpdateListButton.Location = new System.Drawing.Point(663, 261); + this.UpdateListButton.Location = new System.Drawing.Point(728, 262); this.UpdateListButton.Name = "UpdateListButton"; this.UpdateListButton.Size = new System.Drawing.Size(125, 33); this.UpdateListButton.TabIndex = 6; @@ -138,7 +138,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(865, 450); this.Controls.Add(this.UpdateListButton); this.Controls.Add(this.IssuedOrderButton); this.Controls.Add(this.OrderReadyButton); diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index 4c18d71..d4eed9a 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -99,6 +99,7 @@ namespace SoftwareInstallationView { Id = id, PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(), Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), @@ -133,6 +134,7 @@ namespace SoftwareInstallationView { Id = id, PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(), Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), @@ -167,6 +169,7 @@ namespace SoftwareInstallationView { Id = id, PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value), + PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(), Status = Enum.Parse(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value), Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.resx b/SoftwareInstallation/SoftwareInstallation/FormMain.resx index a694815..df8d8ea 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.resx +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.resx @@ -60,4 +60,7 @@ 17, 17 + + 31 + \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs index a02d9a6..b860a33 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs @@ -10,6 +10,7 @@ namespace SoftwareInstallationDataModels.Models public interface IOrderModel : IId { int PackageId { get; } + string PackageName { get; } int Count { get; } double Sum { get; } OrderStatus Status { get; } diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs index 8d3e254..b13976e 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using SofrwareInstallationContracts.BindingModels; @@ -15,6 +16,8 @@ namespace SoftwareInstallationListImplement.Models { public int PackageId { get; private set; } + public string PackageName { get; private set; } + public int Count { get; private set; } public double Sum { get; private set; } @@ -37,6 +40,7 @@ namespace SoftwareInstallationListImplement.Models { Id = model.Id, PackageId = model.PackageId, + PackageName=model.PackageName, Count = model.Count, Sum=model.Sum, Status = model.Status, @@ -52,6 +56,7 @@ namespace SoftwareInstallationListImplement.Models return; } PackageId = model.PackageId; + PackageName = model.PackageName; Count = model.Count; Sum = model.Sum; Status = model.Status; @@ -63,6 +68,7 @@ namespace SoftwareInstallationListImplement.Models { Id = Id, PackageId = PackageId, + PackageName = PackageName, Count = Count, Sum = Sum, Status = Status, -- 2.25.1 From 7433b72a758cf3d5df5e219f8831812f90d42452 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Tue, 31 Jan 2023 13:05:58 +0400 Subject: [PATCH 10/12] =?UTF-8?q?=D0=A1=D0=B4=D0=B0=D0=BD=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ComponentViewModel.cs | 7 +-- .../ViewModels/OrderViewModel.cs | 7 +-- .../ViewModels/PackageViewModel.cs | 7 +-- .../SoftwareInstallation/FormComponent.cs | 11 +--- .../SoftwareInstallation/FormComponents.cs | 9 ---- .../SoftwareInstallation/FormCreateOrder.cs | 11 +--- .../SoftwareInstallation/FormMain.cs | 9 ---- .../FormPackage.Designer.cs | 54 +++++++++---------- .../SoftwareInstallation/FormPackage.cs | 11 +--- .../FormPackageComponent.cs | 11 +--- .../SoftwareInstallation/FormPackages.cs | 11 +--- .../BusinessLogic/ComponentLogic.cs | 7 +-- .../BusinessLogic/OrderLogic.cs | 7 +-- .../BusinessLogic/PackageLogic.cs | 7 +-- .../Enums/OrderStatus.cs | 8 +-- .../SoftwareInstallationDataModels/IId.cs | 8 +-- .../Models/IComponentModel.cs | 8 +-- .../Models/IOrderModel.cs | 7 +-- .../Models/IPackageModel.cs | 8 +-- .../DataListSingleton.cs | 7 +-- .../Implements/ComponentStorage.cs | 7 +-- .../Implements/OrderStorage.cs | 7 +-- .../Implements/PackageStorage.cs | 7 +-- .../Models/Component.cs | 7 +-- .../Models/Order.cs | 9 +--- .../Models/Package.cs | 7 +-- 26 files changed, 50 insertions(+), 209 deletions(-) diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs index 0c89e77..ee989bc 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/ComponentViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; using System.ComponentModel; namespace SofrwareInstallationContracts.ViewModels diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index dcec9b6..cd97df5 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Enums; using SoftwareInstallationDataModels.Models; using System.ComponentModel; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs index fb6d599..e43c8e2 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/PackageViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; using System.ComponentModel; namespace SofrwareInstallationContracts.ViewModels diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs index 1986d04..0f58433 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponent.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponent.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using Microsoft.Extensions.Logging; diff --git a/SoftwareInstallation/SoftwareInstallation/FormComponents.cs b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs index 5d0f184..fc72462 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormComponents.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormComponents.cs @@ -1,15 +1,6 @@ using Microsoft.Extensions.Logging; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace SoftwareInstallationView { diff --git a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs index 48c9170..ab11b3a 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormCreateOrder.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using Microsoft.Extensions.Logging; diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index d4eed9a..8942888 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -2,15 +2,6 @@ using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SoftwareInstallationDataModels.Enums; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace SoftwareInstallationView { diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs index e20ba42..093e2bb 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.Designer.cs @@ -28,9 +28,9 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.PackageNameLabel = new System.Windows.Forms.Label(); this.PriceLabel = new System.Windows.Forms.Label(); this.PackageNameTextBox = new System.Windows.Forms.TextBox(); @@ -138,37 +138,37 @@ // // DataGridView // - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.ID, this.ComponentNameField, this.CountField}); - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.DataGridView.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.DataGridView.DefaultCellStyle = dataGridViewCellStyle2; this.DataGridView.Location = new System.Drawing.Point(6, 22); this.DataGridView.Name = "DataGridView"; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.DataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; this.DataGridView.RowTemplate.Height = 25; this.DataGridView.Size = new System.Drawing.Size(561, 322); this.DataGridView.TabIndex = 0; diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackage.cs b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs index 2899e22..4732133 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackage.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackage.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using SoftwareInstallationDataModels.Models; diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs index bcb0e2e..b6ea33d 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackageComponent.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using SofrwareInstallationContracts.BusinessLogicsContracts; +using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.ViewModels; using SoftwareInstallationDataModels.Models; diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs index 432b08f..c2ab63c 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs index 280d347..c623901 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/ComponentLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.StoragesContracts; diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs index 1e021a9..b65e541 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/OrderLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.StoragesContracts; diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs index e9ee272..77628e8 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogic/PackageLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.BusinessLogicsContracts; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.StoragesContracts; diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs index f83f095..7cf4108 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Enums/OrderStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SoftwareInstallationDataModels.Enums +namespace SoftwareInstallationDataModels.Enums { public enum OrderStatus { diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/IId.cs b/SoftwareInstallation/SoftwareInstallationDataModels/IId.cs index 4c444f5..b1a50f6 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/IId.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/IId.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SoftwareInstallationDataModels +namespace SoftwareInstallationDataModels { public interface IId { diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs index 685e812..87a79db 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IComponentModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SoftwareInstallationDataModels.Models +namespace SoftwareInstallationDataModels.Models { public interface IComponentModel : IId { diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs index b860a33..3fa81f9 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IOrderModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Enums; +using SoftwareInstallationDataModels.Enums; namespace SoftwareInstallationDataModels.Models { diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs index 2422691..530c8ca 100644 --- a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IPackageModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SoftwareInstallationDataModels.Models +namespace SoftwareInstallationDataModels.Models { public interface IPackageModel : IId { diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs b/SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs index 051fc2c..22a2815 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/DataListSingleton.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationListImplement.Models; +using SoftwareInstallationListImplement.Models; namespace SoftwareInstallationListImplement { diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs index 954b1d1..177eebb 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ComponentStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.StoragesContracts; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs index efb4dd7..5c444fa 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/OrderStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.StoragesContracts; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs index ab5e15e..03a3c37 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/PackageStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.StoragesContracts; +using SofrwareInstallationContracts.StoragesContracts; using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs index b4b1801..c449b1a 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Component.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.ViewModels; using SoftwareInstallationDataModels.Models; diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs index b13976e..09a4a71 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Order.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.ViewModels; using SoftwareInstallationDataModels.Enums; using SoftwareInstallationDataModels.Models; diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs index d837b90..169b647 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Models/Package.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.ViewModels; using SoftwareInstallationDataModels.Models; -- 2.25.1 From 9b38a213e335414c748dfd57fad3eea9fc3c7268 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Tue, 31 Jan 2023 13:10:23 +0400 Subject: [PATCH 11/12] =?UTF-8?q?=D0=A1=D0=B4=D0=B0=D0=BD=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ComponentBindingModel.cs | 7 +------ .../BindingModels/OrderBindingModel.cs | 7 +------ .../BindingModels/PackageBindingModel.cs | 7 +------ .../BusinessLogicsContracts/IComponentLogic.cs | 7 +------ .../BusinessLogicsContracts/IOrderLogic.cs | 7 +------ .../BusinessLogicsContracts/IPackageLogic.cs | 7 +------ .../SearchModels/ComponentSearchModel.cs | 8 +------- .../SearchModels/OrderSearchModel.cs | 8 +------- .../SearchModels/PackageSearchModel.cs | 8 +------- .../StoragesContracts/IComponentStorage.cs | 7 +------ .../StoragesContracts/IOrderStorage.cs | 7 +------ .../StoragesContracts/IPackageStorage.cs | 7 +------ 12 files changed, 12 insertions(+), 75 deletions(-) diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs index 8d77a7d..331ecc3 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/ComponentBindingModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; namespace SofrwareInstallationContracts.BindingModels { diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs index 0d83ee0..ec9c4ef 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/OrderBindingModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; using SoftwareInstallationDataModels.Enums; namespace SofrwareInstallationContracts.BindingModels diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs index a4bff75..ab3f646 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/PackageBindingModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SoftwareInstallationDataModels.Models; +using SoftwareInstallationDataModels.Models; namespace SofrwareInstallationContracts.BindingModels { diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs index f469e51..e3ab7ad 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IComponentLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs index 438a365..a00e584 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs index 73acc0c..10123fa 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IPackageLogic.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs index 56c891a..a0b5bf3 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/ComponentSearchModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class ComponentSearchModel { diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs index 470ed6e..a42a1bc 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/OrderSearchModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class OrderSearchModel { diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs index f8484e3..b513c55 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/PackageSearchModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SofrwareInstallationContracts.SearchModels +namespace SofrwareInstallationContracts.SearchModels { public class PackageSearchModel { diff --git a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs index 9395f8a..49a0eeb 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IComponentStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs index 057fbf3..8331264 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IOrderStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; diff --git a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs index fa07a03..a96e010 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IPackageStorage.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.BindingModels; using SofrwareInstallationContracts.SearchModels; using SofrwareInstallationContracts.ViewModels; -- 2.25.1 From f038162bcd5929e0b0a813d13078f81f61d95845 Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Sat, 11 Feb 2023 12:15:10 +0400 Subject: [PATCH 12/12] =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SoftwareInstallation/SoftwareInstallation/FormPackages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs index c2ab63c..9d6c8cb 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormPackages.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormPackages.cs @@ -16,7 +16,7 @@ namespace SoftwareInstallationView _logic = logic; } - private void FormComponents_Load(object sender, EventArgs e) + private void FormPackages_Load(object sender, EventArgs e) { LoadData(); } -- 2.25.1