From 0bfe8b692ca34ceff7323d3fa71af5d8c4ff85ee Mon Sep 17 00:00:00 2001 From: AnnZhimol Date: Fri, 10 Feb 2023 13:43:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=81=D1=83?= =?UTF-8?q?=D1=89=D0=BD=D0=BE=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/StoreBindingModel.cs | 17 +++++++++++++++++ .../BusinessLogicsContracts/IStoreLogic.cs | 17 +++++++++++++++++ .../SearchModels/StoreSearchModel.cs | 8 ++++++++ .../StoragesContracts/IStoreStorage.cs | 16 ++++++++++++++++ .../ViewModels/OrderViewModel.cs | 2 -- .../ViewModels/StoreViewModel.cs | 18 ++++++++++++++++++ .../Models/IStoreModel.cs | 10 ++++++++++ 7 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs create mode 100644 SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs create mode 100644 SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs create mode 100644 SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs create mode 100644 SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs create mode 100644 SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs new file mode 100644 index 0000000..27beff7 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs @@ -0,0 +1,17 @@ +using SoftwareInstallationDataModels.Models; + +namespace SofrwareInstallationContracts.BindingModels +{ + public class StoreBindingModel : IStoreModel + { + public string StoreName { get; set; } = string.Empty; + public string StoreAdress { get; set; } = string.Empty; + + public DateTime OpeningDate { get; set; } = DateTime.Now; + + public Dictionary Packages { get; set; } = new (); + + public int Id { get; set; } + + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs new file mode 100644 index 0000000..06f9a76 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs @@ -0,0 +1,17 @@ +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Models; + +namespace SofrwareInstallationContracts.BusinessLogicsContracts +{ + public interface IStoreLogic + { + List? ReadList(StoreSearchModel? model); + StoreViewModel? ReadElement(StoreSearchModel model); + bool Create(StoreBindingModel model); + bool Update(StoreBindingModel model); + bool Delete(StoreBindingModel model); + bool AddPackage(StoreSearchModel model, IPackageModel package, int quantity); + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs new file mode 100644 index 0000000..3e7c33a --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs @@ -0,0 +1,8 @@ +namespace SofrwareInstallationContracts.SearchModels +{ + public class StoreSearchModel + { + public int? Id { get; set; } + public string? StoreName { get; set; } + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs new file mode 100644 index 0000000..c07f88f --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs @@ -0,0 +1,16 @@ +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; + +namespace SofrwareInstallationContracts.StoragesContracts +{ + public interface IStoreStorage + { + List GetFullList(); + List GetFilteredList(StoreSearchModel model); + StoreViewModel? GetElement(StoreSearchModel model); + StoreViewModel? Insert(StoreBindingModel model); + StoreViewModel? Update(StoreBindingModel model); + StoreViewModel? Delete(StoreBindingModel model); + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index cd97df5..645511f 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -28,7 +28,5 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Дата выполнения")] public DateTime? DateImplement { get; set; } - - } } diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs new file mode 100644 index 0000000..87a7ff3 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs @@ -0,0 +1,18 @@ +using SoftwareInstallationDataModels.Models; +using System.ComponentModel; + +namespace SofrwareInstallationContracts.ViewModels +{ + public class StoreViewModel : IStoreModel + { + public Dictionary Packages { get; set; } = new(); + public int Id { get; set; } + + [DisplayName("Название магазина")] + public string StoreName { get; set; } = string.Empty; + [DisplayName("Адрес магазина")] + public string StoreAdress { get; set; } = string.Empty; + [DisplayName("Дата открытия")] + public DateTime OpeningDate { get; set; } = DateTime.Now; + } +} diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs new file mode 100644 index 0000000..5422c7a --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs @@ -0,0 +1,10 @@ +namespace SoftwareInstallationDataModels.Models +{ + public interface IStoreModel : IId + { + public string StoreName { get; set; } + public string StoreAdress { get; set; } + DateTime OpeningDate { get; } + Dictionary Packages { get; } + } +}