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