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; + } +}