diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/MessageInfoBindingModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/MessageInfoBindingModel.cs new file mode 100644 index 0000000..10e611a --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BindingModels/MessageInfoBindingModel.cs @@ -0,0 +1,19 @@ +using FurnitureAssemblyDataModels.Models; + +namespace FurnitureAssemblyContracts.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/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IMessageInfoLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IMessageInfoLogic.cs new file mode 100644 index 0000000..2b7e15d --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IMessageInfoLogic.cs @@ -0,0 +1,12 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.SearchModels; +using FurnitureAssemblyContracts.ViewModels; + +namespace FurnitureAssemblyContracts.BusinessLogicsContarcts +{ + public interface IMessageInfoLogic + { + List? ReadList(MessageInfoSearchModel? model); + bool Create(MessageInfoBindingModel model); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/MessageInfoSearchModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/MessageInfoSearchModel.cs new file mode 100644 index 0000000..15a6b8e --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/SearchModels/MessageInfoSearchModel.cs @@ -0,0 +1,9 @@ +namespace FurnitureAssemblyContracts.SearchModels +{ + public class MessageInfoSearchModel + { + public int? ClientId { get; set; } + + public string? MessageId { get; set; } + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IMessageInfoStorage.cs b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IMessageInfoStorage.cs new file mode 100644 index 0000000..10663b3 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/StoragesContracts/IMessageInfoStorage.cs @@ -0,0 +1,14 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.SearchModels; +using FurnitureAssemblyContracts.ViewModels; + +namespace FurnitureAssemblyContracts.StoragesContracts +{ + public interface IMessageInfoStorage + { + List GetFullList(); + List GetFilteredList(MessageInfoSearchModel model); + MessageInfoViewModel? GetElement(MessageInfoSearchModel model); + MessageInfoViewModel? Insert(MessageInfoBindingModel model); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/MessageInfoViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/MessageInfoViewModel.cs new file mode 100644 index 0000000..98b85aa --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/MessageInfoViewModel.cs @@ -0,0 +1,20 @@ +using FurnitureAssemblyDataModels.Models; +using System.ComponentModel; + +namespace FurnitureAssemblyContracts.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/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IMessageInfoModel.cs b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IMessageInfoModel.cs new file mode 100644 index 0000000..6139889 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyDataModels/Models/IMessageInfoModel.cs @@ -0,0 +1,12 @@ +namespace FurnitureAssemblyDataModels.Models +{ + public interface IMessageInfoModel + { + string MessageId { get; } + int? ClientId { get; } + string SenderName { get; } + DateTime DateDelivery { get; } + string Subject { get; } + string Body { get; } + } +}