From ead38d06d304b161d59e5c6d674680d3cc9a74f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A4=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sun, 19 May 2024 19:18:06 +0400 Subject: [PATCH] Expenses contracts --- .../BindingModels/ExpensesBindingModel.cs | 14 +++++++++++++ .../BusinessLogicContracts/IExpensesLogic.cs | 14 +++++++++++++ .../SearchModels/ExpensesSearchModel.cs | 11 ++++++++++ .../StorageContracts/IExpensesStorage.cs | 16 ++++++++++++++ .../ViewModels/ExpensesViewModel.cs | 21 +++++++++++++++++++ .../Models/IExpensesModel.cs | 13 ++++++++++++ 6 files changed, 89 insertions(+) create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/ExpensesBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IExpensesLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/ExpensesSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/StorageContracts/IExpensesStorage.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/ExpensesViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopDataModels/Models/IExpensesModel.cs diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ExpensesBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ExpensesBindingModel.cs new file mode 100644 index 0000000..ded9b77 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ExpensesBindingModel.cs @@ -0,0 +1,14 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels { + public class ExpensesBindingModel : IExpensesModel { + public int ClientID { get; set; } + public int Sum { get; set; } + public int OrderCount { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IExpensesLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IExpensesLogic.cs new file mode 100644 index 0000000..f9feed5 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IExpensesLogic.cs @@ -0,0 +1,14 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts { + public interface IExpensesLogic { + ExpensesViewModel? ReadElement(ExpensesBindingModel model); + ExpensesViewModel? Create(ExpensesBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/ExpensesSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ExpensesSearchModel.cs new file mode 100644 index 0000000..d829846 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ExpensesSearchModel.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels { + public class ExpensesSearchModel { + public int ClientID { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/StorageContracts/IExpensesStorage.cs b/ElectronicsShop/ElectronicsShopContracts/StorageContracts/IExpensesStorage.cs new file mode 100644 index 0000000..67ef78f --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/StorageContracts/IExpensesStorage.cs @@ -0,0 +1,16 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.StorageContracts { + public interface IExpensesStorage { + ExpensesViewModel? GetElement(ExpensesSearchModel model); + + ExpensesViewModel Create(ExpensesBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ExpensesViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ExpensesViewModel.cs new file mode 100644 index 0000000..c84c31f --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ExpensesViewModel.cs @@ -0,0 +1,21 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels { + public class ExpensesViewModel : IExpensesModel { + + [DisplayName("Клиента ID")] + public int ClientID { get; set; } + + [DisplayName("Сумма всех заказов")] + public int Sum { get; set; } + + [DisplayName("Заказов всего")] + public int OrderCount { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopDataModels/Models/IExpensesModel.cs b/ElectronicsShop/ElectronicsShopDataModels/Models/IExpensesModel.cs new file mode 100644 index 0000000..97f1077 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopDataModels/Models/IExpensesModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopDataModels.Models { + public interface IExpensesModel { + int ClientID { get; } + int Sum { get; } + int OrderCount { get; } + } +}