From eb82dac496ea7a878b35959bcd71cf4aa29a69ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Mon, 13 Mar 2023 18:39:11 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D1=8C=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/MessageInfoBindingModel.cs | 24 +++++++++++++++ .../IMessageInfoLogic.cs | 18 ++++++++++++ .../SearchModels/MessageInfoSearchModel.cs | 15 ++++++++++ .../StoragesContract/IMessageInfoStorage.cs | 22 ++++++++++++++ .../ViewModels/MessageInfoViewModel.cs | 29 +++++++++++++++++++ ConfectioneryDataModels/IMessageInfoModel.cs | 23 +++++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 ConfectioneryContracts/BindingModels/MessageInfoBindingModel.cs create mode 100644 ConfectioneryContracts/BusinessLogicsContracts/IMessageInfoLogic.cs create mode 100644 ConfectioneryContracts/SearchModels/MessageInfoSearchModel.cs create mode 100644 ConfectioneryContracts/StoragesContract/IMessageInfoStorage.cs create mode 100644 ConfectioneryContracts/ViewModels/MessageInfoViewModel.cs create mode 100644 ConfectioneryDataModels/IMessageInfoModel.cs diff --git a/ConfectioneryContracts/BindingModels/MessageInfoBindingModel.cs b/ConfectioneryContracts/BindingModels/MessageInfoBindingModel.cs new file mode 100644 index 0000000..984939b --- /dev/null +++ b/ConfectioneryContracts/BindingModels/MessageInfoBindingModel.cs @@ -0,0 +1,24 @@ +using ConfectioneryDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.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 string Subject { get; set; } = string.Empty; + + public string Body { get; set; } = string.Empty; + + public DateTime DateDelivery { get; set; } + } +} diff --git a/ConfectioneryContracts/BusinessLogicsContracts/IMessageInfoLogic.cs b/ConfectioneryContracts/BusinessLogicsContracts/IMessageInfoLogic.cs new file mode 100644 index 0000000..ed4b54c --- /dev/null +++ b/ConfectioneryContracts/BusinessLogicsContracts/IMessageInfoLogic.cs @@ -0,0 +1,18 @@ +using ConfectioneryContracts.BindingModels; +using ConfectioneryContracts.SearchModels; +using ConfectioneryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.BusinessLogicsContracts +{ + public interface IMessageInfoLogic + { + List? ReadList(MessageInfoSearchModel? model); + + bool Create(MessageInfoBindingModel model); + } +} diff --git a/ConfectioneryContracts/SearchModels/MessageInfoSearchModel.cs b/ConfectioneryContracts/SearchModels/MessageInfoSearchModel.cs new file mode 100644 index 0000000..e344281 --- /dev/null +++ b/ConfectioneryContracts/SearchModels/MessageInfoSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.SearchModels +{ + public class MessageInfoSearchModel + { + public int? ClientId { get; set; } + + public string? MessageId { get; set; } + } +} diff --git a/ConfectioneryContracts/StoragesContract/IMessageInfoStorage.cs b/ConfectioneryContracts/StoragesContract/IMessageInfoStorage.cs new file mode 100644 index 0000000..6bb7375 --- /dev/null +++ b/ConfectioneryContracts/StoragesContract/IMessageInfoStorage.cs @@ -0,0 +1,22 @@ +using ConfectioneryContracts.BindingModels; +using ConfectioneryContracts.SearchModels; +using ConfectioneryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.StoragesContract +{ + public interface IMessageInfoStorage + { + List GetFullList(); + + List GetFilteredList(MessageInfoSearchModel model); + + MessageInfoViewModel? GetElement(MessageInfoSearchModel model); + + MessageInfoViewModel? Insert(MessageInfoBindingModel model); + } +} diff --git a/ConfectioneryContracts/ViewModels/MessageInfoViewModel.cs b/ConfectioneryContracts/ViewModels/MessageInfoViewModel.cs new file mode 100644 index 0000000..5e38e72 --- /dev/null +++ b/ConfectioneryContracts/ViewModels/MessageInfoViewModel.cs @@ -0,0 +1,29 @@ +using ConfectioneryDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.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; + } +} diff --git a/ConfectioneryDataModels/IMessageInfoModel.cs b/ConfectioneryDataModels/IMessageInfoModel.cs new file mode 100644 index 0000000..38e68a1 --- /dev/null +++ b/ConfectioneryDataModels/IMessageInfoModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels +{ + public interface IMessageInfoModel + { + string MessageId { get; } + + int? ClientId { get; } + + string SenderName { get; } + + DateTime DateDelivery { get; } + + string Subject { get; } + + string Body { get; } + } +}