From bcda89c22eab7a691527810f5044058d75f22532 Mon Sep 17 00:00:00 2001 From: dyakonovr Date: Thu, 2 May 2024 23:19:47 +0400 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D0=BE=D0=BC=D0=B5=D0=BD=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ReportLogic.cs | 23 ------------------- .../Implements/ImplementerStorage.cs | 12 +++++----- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs index f88dcf6..77c8655 100644 --- a/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/SoftwareInstallation/SoftwareInstallationBusinessLogic/BusinessLogics/ReportLogic.cs @@ -30,29 +30,6 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogics } public List GetPackageComponent() { - /*var components = _componentStorage.GetFullList(); - var packages = _packageStorage.GetFullList(); - var list = new List(); - foreach (var package in packages) - { - var record = new ReportPackageComponentViewModel - { - PackageName = package.PackageName, - Components = new List>(), - TotalCount = 0 - }; - foreach (var package in packages) - { - if (package.PackageComponents.ContainsKey(component.Id)) - { - record.Packages.Add(new Tuple(package.PackageName, package.PackageComponents[component.Id].Item2)); - record.TotalCount += package.PackageComponents[component.Id].Item2; - } - } - list.Add(record); - } - return list;*/ - return _packageStorage.GetFullList().Select(x => new ReportPackageComponentViewModel { PackageName = x.PackageName, diff --git a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ImplementerStorage.cs b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ImplementerStorage.cs index 1d93ef5..4afcbbc 100644 --- a/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ImplementerStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationListImplement/Implements/ImplementerStorage.cs @@ -104,14 +104,14 @@ namespace SoftwareInstallationListImplement.Implements } } - return null; - /*var res = Implementer.Create(model);*/ - - /*if (res != null) + var newImplementer = Implementer.Create(model); + if (newImplementer == null) { - _source.Implementers.Add(res); + return null; } - return res?.GetViewModel;*/ + + _source.Implementers.Add(newImplementer); + return newImplementer.GetViewModel; } public ImplementerViewModel? Update(ImplementerBindingModel model)