From 8b437f5de9eed7906b1cae0125dd3d51429396be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=9C=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D1=84=D0=B5=D0=B5=D0=B2?= Date: Sun, 5 May 2024 16:27:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B1=D0=B0=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/MessageInfoBindingModel.cs | 24 ++++++++++++++++++ .../IMessageInfoLogic.cs | 17 +++++++++++++ .../SearchModels/MessageInfoSearchModel.cs | 14 +++++++++++ .../StoragesContracts/IMessageInfoStorage.cs | 20 +++++++++++++++ .../ViewModels/MessageInfoViewModel.cs | 25 +++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 JewelryStore/JewelryStoreContracts/BindingModels/MessageInfoBindingModel.cs create mode 100644 JewelryStore/JewelryStoreContracts/BusinessLogicsContracts/IMessageInfoLogic.cs create mode 100644 JewelryStore/JewelryStoreContracts/SearchModels/MessageInfoSearchModel.cs create mode 100644 JewelryStore/JewelryStoreContracts/StoragesContracts/IMessageInfoStorage.cs create mode 100644 JewelryStore/JewelryStoreContracts/ViewModels/MessageInfoViewModel.cs diff --git a/JewelryStore/JewelryStoreContracts/BindingModels/MessageInfoBindingModel.cs b/JewelryStore/JewelryStoreContracts/BindingModels/MessageInfoBindingModel.cs new file mode 100644 index 0000000..55af3b7 --- /dev/null +++ b/JewelryStore/JewelryStoreContracts/BindingModels/MessageInfoBindingModel.cs @@ -0,0 +1,24 @@ +using JewerlyStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreContracts.BindingModels +{ + public class MessageInfoBindingModel : IMessageInfoModel + { + public string MessageId { get; set; } = string.Empty; + + public int? ClientId { get; set; } + + public string SenderName { get; set; } = string.Empty; + + public DateTime DateDelivery { get; set; } + + public string Subject { get; set; } = string.Empty; + + public string Body { get; set; } = string.Empty; + } +} diff --git a/JewelryStore/JewelryStoreContracts/BusinessLogicsContracts/IMessageInfoLogic.cs b/JewelryStore/JewelryStoreContracts/BusinessLogicsContracts/IMessageInfoLogic.cs new file mode 100644 index 0000000..c8823ba --- /dev/null +++ b/JewelryStore/JewelryStoreContracts/BusinessLogicsContracts/IMessageInfoLogic.cs @@ -0,0 +1,17 @@ +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.SearchModels; +using JewelryStoreContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreContracts.BusinessLogicsContracts +{ + public interface IMessageInfoLogic + { + List? ReadList(MessageInfoSearchModel? model); + bool Create(MessageInfoBindingModel model); + } +} diff --git a/JewelryStore/JewelryStoreContracts/SearchModels/MessageInfoSearchModel.cs b/JewelryStore/JewelryStoreContracts/SearchModels/MessageInfoSearchModel.cs new file mode 100644 index 0000000..253d7a0 --- /dev/null +++ b/JewelryStore/JewelryStoreContracts/SearchModels/MessageInfoSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreContracts.SearchModels +{ + public class MessageInfoSearchModel + { + public string? MessageId { get; set; } + public int? ClientId { get; set; } + } +} diff --git a/JewelryStore/JewelryStoreContracts/StoragesContracts/IMessageInfoStorage.cs b/JewelryStore/JewelryStoreContracts/StoragesContracts/IMessageInfoStorage.cs new file mode 100644 index 0000000..a9df9b9 --- /dev/null +++ b/JewelryStore/JewelryStoreContracts/StoragesContracts/IMessageInfoStorage.cs @@ -0,0 +1,20 @@ +using JewelryStoreContracts.BindingModels; +using JewelryStoreContracts.SearchModels; +using JewelryStoreContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreContracts.StoragesContracts +{ + public interface IMessageInfoStorage + { + List GetFullList(); + List GetFilteredList(MessageInfoSearchModel model); + MessageInfoViewModel? GetElement(MessageInfoSearchModel model); + MessageInfoViewModel? Insert(MessageInfoBindingModel model); + } + +} diff --git a/JewelryStore/JewelryStoreContracts/ViewModels/MessageInfoViewModel.cs b/JewelryStore/JewelryStoreContracts/ViewModels/MessageInfoViewModel.cs new file mode 100644 index 0000000..e0699fa --- /dev/null +++ b/JewelryStore/JewelryStoreContracts/ViewModels/MessageInfoViewModel.cs @@ -0,0 +1,25 @@ +using JewerlyStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace JewelryStoreContracts.ViewModels +{ + public class MessageInfoViewModel : IMessageInfoModel + { + public string MessageId { get; set; } = string.Empty; + + public int? ClientId { get; set; } + [DisplayName("Имя отправителя")] + public string SenderName { get; set; } = string.Empty; + [DisplayName("Дата доставки")] + public DateTime DateDelivery { get; set; } + [DisplayName("Тема письма")] + public string Subject { get; set; } = string.Empty; + [DisplayName("Внутренности письма")] + public string Body { get; set; } = string.Empty; + } +}