From 395e725e78d5fe6e246b1ef7ec67a3c8ec8c2834 Mon Sep 17 00:00:00 2001 From: Factorino73 Date: Sun, 25 Feb 2024 23:08:05 +0400 Subject: [PATCH] LabWork02_Hard start --- .../BindingModels/ShopBindingModel.cs | 5 +++++ .../BusinessLogicsContracts/IShopLogic.cs | 16 ++++++++++++++++ .../StoragesContracts/IShopStorage.cs | 9 +++++++++ .../ViewModels/ShopViewModel.cs | 6 ++++++ .../AircraftPlantDataModels/Models/IShopModel.cs | 5 +++++ 5 files changed, 41 insertions(+) diff --git a/AircraftPlant/AircraftPlantContracts/BindingModels/ShopBindingModel.cs b/AircraftPlant/AircraftPlantContracts/BindingModels/ShopBindingModel.cs index 74d61f5..c8aa382 100644 --- a/AircraftPlant/AircraftPlantContracts/BindingModels/ShopBindingModel.cs +++ b/AircraftPlant/AircraftPlantContracts/BindingModels/ShopBindingModel.cs @@ -41,5 +41,10 @@ namespace AircraftPlantContracts.BindingModels get; set; } = new(); + + /// + /// Максимальное количество изделий + /// + public int MaxPlanes { get; set; } } } diff --git a/AircraftPlant/AircraftPlantContracts/BusinessLogicsContracts/IShopLogic.cs b/AircraftPlant/AircraftPlantContracts/BusinessLogicsContracts/IShopLogic.cs index f8bdb53..f23492d 100644 --- a/AircraftPlant/AircraftPlantContracts/BusinessLogicsContracts/IShopLogic.cs +++ b/AircraftPlant/AircraftPlantContracts/BusinessLogicsContracts/IShopLogic.cs @@ -58,5 +58,21 @@ namespace AircraftPlantContracts.BusinessLogicsContracts /// /// bool AddPlaneInShop(ShopSearchModel model, IPlaneModel plane, int count); + + /// + /// Добавление изделий в магазины + /// + /// + /// + /// + bool AddPlanes(IPlaneModel plane, int count); + + /// + /// Продажа изделий + /// + /// + /// + /// + bool SellPlanes(IPlaneModel plane, int count); } } diff --git a/AircraftPlant/AircraftPlantContracts/StoragesContracts/IShopStorage.cs b/AircraftPlant/AircraftPlantContracts/StoragesContracts/IShopStorage.cs index 9c89ffe..9dbabac 100644 --- a/AircraftPlant/AircraftPlantContracts/StoragesContracts/IShopStorage.cs +++ b/AircraftPlant/AircraftPlantContracts/StoragesContracts/IShopStorage.cs @@ -1,6 +1,7 @@ using AircraftPlantContracts.BindingModels; using AircraftPlantContracts.SearchModels; using AircraftPlantContracts.ViewModels; +using AircraftPlantDataModels.Models; using System; using System.Collections.Generic; using System.Linq; @@ -54,5 +55,13 @@ namespace AircraftPlantContracts.StoragesContracts /// /// ShopViewModel? Delete(ShopBindingModel model); + + /// + /// Продажа изделий + /// + /// + /// + /// + bool SellPlanes(IPlaneModel plane, int count); } } diff --git a/AircraftPlant/AircraftPlantContracts/ViewModels/ShopViewModel.cs b/AircraftPlant/AircraftPlantContracts/ViewModels/ShopViewModel.cs index 7ca01d7..44f1df3 100644 --- a/AircraftPlant/AircraftPlantContracts/ViewModels/ShopViewModel.cs +++ b/AircraftPlant/AircraftPlantContracts/ViewModels/ShopViewModel.cs @@ -45,5 +45,11 @@ namespace AircraftPlantContracts.ViewModels get; set; } = new(); + + /// + /// Максимальное количество изделий + /// + [DisplayName("Максимальное количество изделий")] + public int MaxPlanes { get; set; } } } diff --git a/AircraftPlant/AircraftPlantDataModels/Models/IShopModel.cs b/AircraftPlant/AircraftPlantDataModels/Models/IShopModel.cs index ca684fa..780d13a 100644 --- a/AircraftPlant/AircraftPlantDataModels/Models/IShopModel.cs +++ b/AircraftPlant/AircraftPlantDataModels/Models/IShopModel.cs @@ -30,5 +30,10 @@ namespace AircraftPlantDataModels.Models /// Коллекция изделий в магазине /// Dictionary ShopPlanes { get; } + + /// + /// Максимальное количество изделий + /// + int MaxPlanes { get; } } }