diff --git a/SecuritySystem/SecuritySystem/App.config b/SecuritySystem/SecuritySystem/App.config new file mode 100644 index 0000000..e93988a --- /dev/null +++ b/SecuritySystem/SecuritySystem/App.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/SecuritySystem/SecuritySystem/FormMails.Designer.cs b/SecuritySystem/SecuritySystem/FormMails.Designer.cs new file mode 100644 index 0000000..4d7023a --- /dev/null +++ b/SecuritySystem/SecuritySystem/FormMails.Designer.cs @@ -0,0 +1,64 @@ +namespace SecuritySystem +{ + partial class FormMails + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + dataGridView = new DataGridView(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Dock = DockStyle.Fill; + dataGridView.Location = new Point(0, 0); + dataGridView.Margin = new Padding(3, 2, 3, 2); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.Size = new Size(700, 338); + dataGridView.TabIndex = 1; + // + // FormMails + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(700, 338); + Controls.Add(dataGridView); + Name = "FormMails"; + Text = "Письма"; + Load += FormMails_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private DataGridView dataGridView; + } +} \ No newline at end of file diff --git a/SecuritySystem/SecuritySystem/FormMails.cs b/SecuritySystem/SecuritySystem/FormMails.cs new file mode 100644 index 0000000..cee925e --- /dev/null +++ b/SecuritySystem/SecuritySystem/FormMails.cs @@ -0,0 +1,60 @@ +using SecuritySystemBusinessLogic.BusinessLogic; +using SecuritySystemContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SecuritySystem +{ + public partial class FormMails : Form + { + private readonly ILogger _logger; + + private readonly IMessageInfoLogic _messageLogic; + + public FormMails(ILogger logger, IMessageInfoLogic messageLogic) + { + InitializeComponent(); + + _logger = logger; + _messageLogic = messageLogic; + } + + private void FormMails_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + _logger.LogInformation("Загрузка писем"); + + try + { + var list = _messageLogic.ReadList(null); + + if (list != null) + { + dataGridView.DataSource = list; + dataGridView.Columns["MessageId"].Visible = false; + dataGridView.Columns["ClientId"].Visible = false; + dataGridView.Columns["Body"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + } + + _logger.LogInformation("Успешная загрузка писем"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки писем"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/SecuritySystem/SecuritySystem/FormMails.resx b/SecuritySystem/SecuritySystem/FormMails.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/SecuritySystem/SecuritySystem/FormMails.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SecuritySystem/SecuritySystem/FormMain.cs b/SecuritySystem/SecuritySystem/FormMain.cs index 18cfdb7..78a346d 100644 --- a/SecuritySystem/SecuritySystem/FormMain.cs +++ b/SecuritySystem/SecuritySystem/FormMain.cs @@ -185,7 +185,7 @@ namespace SecuritySystem { _workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic); - MessageBox.Show(" ", "", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(" ", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void ImplementerToolStripMenuItem_Click(object sender, EventArgs e) @@ -197,5 +197,15 @@ namespace SecuritySystem form.ShowDialog(); } } + + private void MailsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormMails)); + + if (service is FormMails form) + { + form.ShowDialog(); + } + } } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystem/Program.cs b/SecuritySystem/SecuritySystem/Program.cs index fe0cea5..908f2a3 100644 --- a/SecuritySystem/SecuritySystem/Program.cs +++ b/SecuritySystem/SecuritySystem/Program.cs @@ -1,6 +1,8 @@ using SecuritySystemBusinessLogic.BusinessLogic; +using SecuritySystemBusinessLogic.MailWorker; using SecuritySystemBusinessLogic.OfficePackage; using SecuritySystemBusinessLogic.OfficePackage.Implements; +using SecuritySystemContracts.BindingModels; using SecuritySystemContracts.BusinessLogicsContracts; using SecuritySystemContracts.StoragesContracts; using SecuritySystemDatabaseImplement.Implements; @@ -28,6 +30,31 @@ namespace SecuritySystem var services = new ServiceCollection(); ConfigureServices(services); _serviceProvider = services.BuildServiceProvider(); + + try + { + var mailSender = _serviceProvider.GetService(); + mailSender?.MailConfig(new MailConfigBindingModel + { + MailLogin = System.Configuration.ConfigurationManager.AppSettings["MailLogin"] ?? string.Empty, + MailPassword = System.Configuration.ConfigurationManager.AppSettings["MailPassword"] ?? string.Empty, + SmtpClientHost = System.Configuration.ConfigurationManager.AppSettings["SmtpClientHost"] ?? string.Empty, + SmtpClientPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpClientPort"]), + PopHost = System.Configuration.ConfigurationManager.AppSettings["PopHost"] ?? string.Empty, + PopPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PopPort"]) + }); + + // + var timer = new System.Threading.Timer(new TimerCallback(MailCheck!), null, 0, 100000); + } + catch (Exception ex) + { + var logger = _serviceProvider.GetService(); + + logger?.LogError(ex, " "); + } + + Application.Run(_serviceProvider.GetRequiredService()); } @@ -44,6 +71,7 @@ namespace SecuritySystem services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -51,12 +79,15 @@ namespace SecuritySystem services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddSingleton(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -69,6 +100,9 @@ namespace SecuritySystem services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } + + private static void MailCheck(object obj) => ServiceProvider?.GetService()?.MailCheck(); } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/ClientLogic.cs b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/ClientLogic.cs index e230697..b8c4c6a 100644 --- a/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/ClientLogic.cs +++ b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/ClientLogic.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; namespace SecuritySystemBusinessLogic.BusinessLogic @@ -141,6 +142,16 @@ namespace SecuritySystemBusinessLogic.BusinessLogic throw new ArgumentNullException("Отсутствие пароля в учётной записи", nameof(model.Password)); } + if (!Regex.IsMatch(model.Email, @"^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$", RegexOptions.IgnoreCase)) + { + throw new ArgumentException("Некорректная почта", nameof(model.Email)); + } + + if (!Regex.IsMatch(model.Password, @"^((\w+\d+\W+)|(\w+\W+\d+)|(\d+\w+\W+)|(\d+\W+\w+)|(\W+\w+\d+)|(\W+\d+\w+))[\w\d\W]*$", RegexOptions.IgnoreCase) && model.Password.Length < 10 && model.Password.Length > 50) + { + throw new ArgumentException("Необходимо придумать другой пароль", nameof(model.Password)); + } + _logger.LogInformation("Client. ClientFIO:{ClientFIO}. Email:{Email}. Password:{Password}. Id:{Id}", model.ClientFIO, model.Email, model.Password, model.Id); diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/MessageInfoLogic.cs b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/MessageInfoLogic.cs new file mode 100644 index 0000000..7a19b5e --- /dev/null +++ b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/MessageInfoLogic.cs @@ -0,0 +1,57 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.StoragesContracts; +using SecuritySystemContracts.ViewModels; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecuritySystemBusinessLogic.BusinessLogic +{ + public class MessageInfoLogic : IMessageInfoLogic + { + private readonly ILogger _logger; + + private readonly IMessageInfoStorage _messageInfoStorage; + + public MessageInfoLogic(ILogger logger, IMessageInfoStorage messageInfoStorage) + { + _logger = logger; + _messageInfoStorage = messageInfoStorage; + } + + public List? ReadList(MessageInfoSearchModel? model) + { + _logger.LogInformation("ReadList. MessageId:{MessageId}", model?.MessageId); + + //list хранит весь список в случае, если model пришло со значением null на вход метода + var list = model == null ? _messageInfoStorage.GetFullList() : _messageInfoStorage.GetFilteredList(model); + + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + + return list.OrderByDescending(x => x.DateDelivery).ToList(); + } + + public bool Create(MessageInfoBindingModel model) + { + if (_messageInfoStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + + return false; + } + + return true; + } + } +} diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/OrderLogic.cs b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/OrderLogic.cs index dd9b6e0..0ee314f 100644 --- a/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/OrderLogic.cs +++ b/SecuritySystem/SecuritySystemBusinessLogiс/BusinessLogic/OrderLogic.cs @@ -1,4 +1,5 @@ -using SecuritySystemContracts.BindingModels; +using SecuritySystemBusinessLogic.MailWorker; +using SecuritySystemContracts.BindingModels; using SecuritySystemContracts.BusinessLogicsContracts; using SecuritySystemContracts.SearchModels; using SecuritySystemContracts.StoragesContracts; @@ -20,10 +21,15 @@ namespace SecuritySystemBusinessLogic.BusinessLogic private readonly IOrderStorage _orderStorage; - public OrderLogic(ILogger logger, IOrderStorage orderStorage) + private readonly AbstractMailWorker _mailWorker; + + private readonly IClientLogic _clientLogic; + public OrderLogic(ILogger logger, IOrderStorage orderStorage, AbstractMailWorker mailWorker, IClientLogic clientLogic) { _logger = logger; _orderStorage = orderStorage; + _mailWorker = mailWorker; + _clientLogic = clientLogic; } //вывод отфильтрованного списка компонентов @@ -82,13 +88,17 @@ namespace SecuritySystemBusinessLogic.BusinessLogic model.Status = OrderStatus.Принят; - if (_orderStorage.Insert(model) == null) + var result = _orderStorage.Insert(model); + + if (result == null) { model.Status = OrderStatus.Неизвестен; _logger.LogWarning("Insert operation failed"); return false; } + SendOrderMessage(result.ClientId, $"Кузнечная мастерская, Заказ №{result.Id}", $"Заказ №{result.Id} от {result.DateCreate} на сумму {result.Sum:0.00} принят"); + return true; } @@ -191,8 +201,10 @@ namespace SecuritySystemBusinessLogic.BusinessLogic CheckModel(model, false); + var result = _orderStorage.Update(model); + //финальная проверка на возможность обновления - if (_orderStorage.Update(model) == null) + if (result == null) { model.Status--; @@ -201,6 +213,27 @@ namespace SecuritySystemBusinessLogic.BusinessLogic return false; } + SendOrderMessage(result.ClientId, $"Кузнечаня мастерская, Заказ №{result.Id}", $"Заказ №{model.Id} изменен статус на {result.Status}"); + + return true; + } + + private bool SendOrderMessage(int clientId, string subject, string text) + { + var client = _clientLogic.ReadElement(new() { Id = clientId }); + + if (client == null) + { + return false; + } + + _mailWorker.MailSendAsync(new() + { + MailAddress = client.Email, + Subject = subject, + Text = text + }); + return true; } } diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/AbstractMailWorker.cs b/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/AbstractMailWorker.cs new file mode 100644 index 0000000..9005762 --- /dev/null +++ b/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/AbstractMailWorker.cs @@ -0,0 +1,107 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SecuritySystemBusinessLogic.MailWorker +{ + public abstract class AbstractMailWorker + { + protected string _mailLogin = string.Empty; + + protected string _mailPassword = string.Empty; + + protected string _smtpClientHost = string.Empty; + + protected int _smtpClientPort; + + protected string _popHost = string.Empty; + + protected int _popPort; + + private readonly IMessageInfoLogic _messageInfoLogic; + + private readonly IClientLogic _clientLogic; + + private readonly ILogger _logger; + + public AbstractMailWorker(ILogger logger, IMessageInfoLogic messageInfoLogic, IClientLogic clientLogic) + { + _logger = logger; + _messageInfoLogic = messageInfoLogic; + _clientLogic = clientLogic; + } + + public void MailConfig(MailConfigBindingModel config) + { + _mailLogin = config.MailLogin; + _mailPassword = config.MailPassword; + _smtpClientHost = config.SmtpClientHost; + _smtpClientPort = config.SmtpClientPort; + _popHost = config.PopHost; + _popPort = config.PopPort; + + _logger.LogDebug("Config: {login}, {password}, {clientHost}, {clientPOrt}, { popHost}, { popPort}", + _mailLogin, _mailPassword, _smtpClientHost, _smtpClientPort, _popHost, _popPort); + } + + public async void MailSendAsync(MailSendInfoBindingModel info) + { + if (string.IsNullOrEmpty(_mailLogin) || string.IsNullOrEmpty(_mailPassword)) + { + return; + } + + if (string.IsNullOrEmpty(_smtpClientHost) || _smtpClientPort == 0) + { + return; + } + + if (string.IsNullOrEmpty(info.MailAddress) || string.IsNullOrEmpty(info.Subject) || string.IsNullOrEmpty(info.Text)) + { + return; + } + + _logger.LogDebug("Send Mail: {To}, {Subject}", info.MailAddress, info.Subject); + + await SendMailAsync(info); + } + + public async void MailCheck() + { + if (string.IsNullOrEmpty(_mailLogin) || string.IsNullOrEmpty(_mailPassword)) + { + return; + } + + if (string.IsNullOrEmpty(_popHost) || _popPort == 0) + { + return; + } + + if (_messageInfoLogic == null) + { + return; + } + + var list = await ReceiveMailAsync(); + + _logger.LogDebug("Check Mail: {Count} new mails", list.Count); + + foreach (var mail in list) + { + mail.ClientId = _clientLogic.ReadElement(new() { Email = mail.SenderName })?.Id; + + _messageInfoLogic.Create(mail); + } + } + + protected abstract Task SendMailAsync(MailSendInfoBindingModel info); + + protected abstract Task> ReceiveMailAsync(); + } +} diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/MailKitWorker.cs b/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/MailKitWorker.cs new file mode 100644 index 0000000..3c8b06e --- /dev/null +++ b/SecuritySystem/SecuritySystemBusinessLogiс/MailWorker/MailKitWorker.cs @@ -0,0 +1,91 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mail; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using MailKit.Net.Pop3; +using MailKit.Security; + +namespace SecuritySystemBusinessLogic.MailWorker +{ + public class MailKitWorker : AbstractMailWorker + { + public MailKitWorker(ILogger logger, IMessageInfoLogic messageInfoLogic, IClientLogic clientLogic) + : base(logger, messageInfoLogic, clientLogic) { } + + protected override async Task SendMailAsync(MailSendInfoBindingModel info) + { + using var objMailMessage = new MailMessage(); + + using var objSmtpClient = new SmtpClient(_smtpClientHost, _smtpClientPort); + + try + { + objMailMessage.From = new MailAddress(_mailLogin); + objMailMessage.To.Add(new MailAddress(info.MailAddress)); + objMailMessage.Subject = info.Subject; + objMailMessage.Body = info.Text; + objMailMessage.SubjectEncoding = Encoding.UTF8; + objMailMessage.BodyEncoding = Encoding.UTF8; + + objSmtpClient.UseDefaultCredentials = false; + objSmtpClient.EnableSsl = true; + objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; + objSmtpClient.Credentials = new NetworkCredential(_mailLogin, _mailPassword); + + await Task.Run(() => objSmtpClient.Send(objMailMessage)); + } + catch (Exception) + { + throw; + } + } + + protected override async Task> ReceiveMailAsync() + { + var list = new List(); + + using var client = new Pop3Client(); + + await Task.Run(() => + { + try + { + client.Connect(_popHost, _popPort, SecureSocketOptions.SslOnConnect); + + client.Authenticate(_mailLogin, _mailPassword); + + for (int i = 0; i < client.Count; i++) + { + var message = client.GetMessage(i); + + foreach (var mail in message.From.Mailboxes) + { + list.Add(new MessageInfoBindingModel + { + DateDelivery = message.Date.DateTime, + MessageId = message.MessageId, + SenderName = mail.Address, + Subject = message.Subject, + Body = message.TextBody + }); + } + } + } + catch (AuthenticationException) + { } + finally + { + client.Disconnect(true); + } + }); + + return list; + } + } +} diff --git a/SecuritySystem/SecuritySystemBusinessLogiс/SecuritySystemBusinessLogiс.csproj b/SecuritySystem/SecuritySystemBusinessLogiс/SecuritySystemBusinessLogiс.csproj index b2a2c49..cfd574a 100644 --- a/SecuritySystem/SecuritySystemBusinessLogiс/SecuritySystemBusinessLogiс.csproj +++ b/SecuritySystem/SecuritySystemBusinessLogiс/SecuritySystemBusinessLogiс.csproj @@ -8,6 +8,7 @@ + diff --git a/SecuritySystem/SecuritySystemClientApp/Controllers/HomeController.cs b/SecuritySystem/SecuritySystemClientApp/Controllers/HomeController.cs index a2a4107..d98eae7 100644 --- a/SecuritySystem/SecuritySystemClientApp/Controllers/HomeController.cs +++ b/SecuritySystem/SecuritySystemClientApp/Controllers/HomeController.cs @@ -44,7 +44,7 @@ namespace SecuritySystemClientApp.Controllers { if (APIClient.Client == null) { - throw new Exception("Вход только авторизованным"); + throw new Exception("Вы как сюда попали? Суда вход только авторизованным"); } if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio)) @@ -146,7 +146,7 @@ namespace SecuritySystemClientApp.Controllers { if (APIClient.Client == null) { - throw new Exception("Вход только авторизованным"); + throw new Exception("Вы как сюда попали? Суда вход только авторизованным"); } if (count <= 0) @@ -174,5 +174,17 @@ namespace SecuritySystemClientApp.Controllers return count * (manuf?.Price ?? 1); } + + //для работы с письмами + [HttpGet] + public IActionResult Mails() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + + return View(APIClient.GetRequest>($"api/client/getmessages?clientId={APIClient.Client.Id}")); + } } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemClientApp/Views/Home/Enter.cshtml b/SecuritySystem/SecuritySystemClientApp/Views/Home/Enter.cshtml index affc9d4..5618938 100644 --- a/SecuritySystem/SecuritySystemClientApp/Views/Home/Enter.cshtml +++ b/SecuritySystem/SecuritySystemClientApp/Views/Home/Enter.cshtml @@ -9,7 +9,7 @@
Логин:
-
diff --git a/SecuritySystem/SecuritySystemClientApp/Views/Home/Mails.cshtml b/SecuritySystem/SecuritySystemClientApp/Views/Home/Mails.cshtml new file mode 100644 index 0000000..b0d9457 --- /dev/null +++ b/SecuritySystem/SecuritySystemClientApp/Views/Home/Mails.cshtml @@ -0,0 +1,51 @@ +@using SecuritySystemContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "Mails"; +} + +
+

Заказы

+
+
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + + + + + + + + + + @foreach (var item in Model) + { + + + + + + } + +
+ Дата письма + + Заголовок + + Текст +
+ @Html.DisplayFor(modelItem => item.DateDelivery) + + @Html.DisplayFor(modelItem => item.Subject) + + @Html.DisplayFor(modelItem => item.Body) +
+ } +
diff --git a/SecuritySystem/SecuritySystemClientApp/Views/Shared/_Layout.cshtml b/SecuritySystem/SecuritySystemClientApp/Views/Shared/_Layout.cshtml index 9668af8..5c75b94 100644 --- a/SecuritySystem/SecuritySystemClientApp/Views/Shared/_Layout.cshtml +++ b/SecuritySystem/SecuritySystemClientApp/Views/Shared/_Layout.cshtml @@ -16,8 +16,8 @@ Система безопасности -