From 92ef919db7324d6c0c503163ed27a8fe1c25b49a 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: Sat, 18 Mar 2023 15:43:00 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=88=D1=82=D1=80=D0=B8=D1=85=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Confectionery/FormReplyMail.cs | 7 +++++-- Confectionery/FormViewMail.cs | 5 +---- ConfectioneryClientApp/Controllers/HomeController.cs | 2 +- ConfectioneryClientApp/Views/Home/Mails.cshtml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Confectionery/FormReplyMail.cs b/Confectionery/FormReplyMail.cs index 8247d8e..7c6ba2d 100644 --- a/Confectionery/FormReplyMail.cs +++ b/Confectionery/FormReplyMail.cs @@ -22,7 +22,7 @@ namespace ConfectioneryView private readonly IMessageInfoLogic _logic; private MessageInfoViewModel _message; - public string MessageId { get; set; } + public string MessageId { get; set; } = string.Empty; public FormReplyMail(ILogger logger, AbstractMailWorker mailWorker, IMessageInfoLogic logic) { @@ -67,7 +67,10 @@ namespace ConfectioneryView Text += $"для {_message.SenderName}"; textBoxHead.Text = _message.Subject; textBoxMail.Text = _message.Body; - _logic.Update(new() { MessageId = MessageId, HasRead = true }); + if (_message.HasRead is false) + { + _logic.Update(new() { MessageId = MessageId, HasRead = true, Reply = _message.Reply }); + } } catch (Exception ex) { diff --git a/Confectionery/FormViewMail.cs b/Confectionery/FormViewMail.cs index 2bedb35..9c7655c 100644 --- a/Confectionery/FormViewMail.cs +++ b/Confectionery/FormViewMail.cs @@ -104,10 +104,7 @@ namespace ConfectioneryView { form.MessageId = (string)dataGridView.Rows[e.RowIndex].Cells["MessageId"].Value; form.ShowDialog(); - if (form.DialogResult == DialogResult.OK) - { - MailLoad(); - } + MailLoad(); } } } diff --git a/ConfectioneryClientApp/Controllers/HomeController.cs b/ConfectioneryClientApp/Controllers/HomeController.cs index 3f551de..f47d812 100644 --- a/ConfectioneryClientApp/Controllers/HomeController.cs +++ b/ConfectioneryClientApp/Controllers/HomeController.cs @@ -192,7 +192,7 @@ namespace ConfectioneryClientApp.Controllers $"{mail.DateDelivery}" + $"{mail.Subject}" + $"{mail.Body}" + - $"{mail.HasRead}" + + "" + (mail.HasRead ? "Прочитано" : "Непрочитано") + "" + $"{mail.Reply}" + ""); } diff --git a/ConfectioneryClientApp/Views/Home/Mails.cshtml b/ConfectioneryClientApp/Views/Home/Mails.cshtml index dfc5013..98fdf1f 100644 --- a/ConfectioneryClientApp/Views/Home/Mails.cshtml +++ b/ConfectioneryClientApp/Views/Home/Mails.cshtml @@ -15,7 +15,7 @@ Текст - Прочитано + Статус Ответ