From 08d8b3e6c5c2bfed0258c8f3a31822c99f50d905 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Mon, 25 Mar 2024 22:13:44 +0400 Subject: [PATCH] lab-3-hard some minor fixes --- .../Implements/ShopStorage.cs | 5 ----- .../BlacksmithWorkshopDatabaseImplement/Models/Shop.cs | 3 --- 2 files changed, 8 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/ShopStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/ShopStorage.cs index 9c5bf2f..01ab771 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/ShopStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/ShopStorage.cs @@ -27,7 +27,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements } return null; } - public ShopViewModel? GetElement(ShopSearchModel model) { if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue) @@ -41,7 +40,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements .FirstOrDefault(x => model.Id.HasValue && x.Id == model.Id) ?.GetViewModel; } - public List GetFilteredList(ShopSearchModel model) { if (string.IsNullOrEmpty(model.ShopName)) @@ -56,7 +54,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements .Where(x => x.ShopName.Contains(model.ShopName ?? string.Empty)) .ToList(); } - public List GetFullList() { using var context = new BlacksmithWorkshopDataBase(); @@ -66,7 +63,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements .Select(x => x.GetViewModel) .ToList(); } - public ShopViewModel? Insert(ShopBindingModel model) { using var context = new BlacksmithWorkshopDataBase(); @@ -90,7 +86,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements throw; } } - public ShopViewModel? Update(ShopBindingModel model) { using var context = new BlacksmithWorkshopDataBase(); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Shop.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Shop.cs index cc3f118..dd05faa 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Shop.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Shop.cs @@ -57,7 +57,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models }).ToList() }; } - public void Update(ShopBindingModel? model) { if (model == null) @@ -69,7 +68,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models OpeningDate = model.OpeningDate; MaxCapacity = model.MaxCapacity; } - public ShopViewModel GetViewModel => new() { Id = Id, @@ -79,7 +77,6 @@ namespace BlacksmithWorkshopDatabaseImplement.Models ShopManufactures = ShopManufactures, MaxCapacity = MaxCapacity }; - public void UpdateManufactures(BlacksmithWorkshopDataBase context, ShopBindingModel model) { var ShopManufacture = context.ShopManufactures.Where(rec =>