Agliullov D. A. Lab Work 7 Hard #20

Closed
d.agliullov wants to merge 34 commits from Lab7_Hard into Lab6_Hard
4 changed files with 8 additions and 8 deletions
Showing only changes of commit 92ef919db7 - Show all commits

View File

@ -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<FormReplyMail> 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)
{

View File

@ -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();
}
}
}

View File

@ -192,7 +192,7 @@ namespace ConfectioneryClientApp.Controllers
$"<td>{mail.DateDelivery}</td>" +
$"<td>{mail.Subject}</td>" +
$"<td>{mail.Body}</td>" +
$"<td>{mail.HasRead}</td>" +
"<td>" + (mail.HasRead ? "Прочитано" : "Непрочитано") + "</td>" +
$"<td>{mail.Reply}</td>" +
"</tr>");
}

View File

@ -15,7 +15,7 @@
Текст
</th>
<th>
Прочитано
Статус
</th>
<th>
Ответ