PIbd-22_Chernyshev_G.Y._LabWork07_Base #8

Closed
ujijrujijr wants to merge 2 commits from LabWork07 into LabWork06
10 changed files with 14 additions and 16 deletions
Showing only changes of commit 6c97579ac0 - Show all commits

View File

@ -5,7 +5,7 @@
<add key="SmtpClientPort" value="587" />
<add key="PopHost" value="pop.gmail.com" />
<add key="PopPort" value="995" />
<add key="MailLogin" value="ujijrujijr@gmail.com" />
<add key="MailPassword" value="twkn exbj fkua jrlw" />
<add key="MailLogin" value="rpplab7chernyshev@gmail.com" />
<add key="MailPassword" value="cojg axan axbk qtqb" />
</appSettings>
</configuration>

View File

@ -40,6 +40,7 @@ namespace GarmentFactoryView
dataGridView.DataSource = list;
dataGridView.Columns["TextileId"].Visible = false;
dataGridView.Columns["ClientId"].Visible = false;
dataGridView.Columns["ClientEmail"].Visible = false;
dataGridView.Columns["ImplementerId"].Visible = false;
dataGridView.Columns["TextileName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

View File

@ -61,7 +61,7 @@ namespace GarmentFactoryBusinessLogic.BusinessLogics
}
if (string.IsNullOrEmpty(model.SenderName))
{
throw new ArgumentNullException("Не указао почта", nameof(model.SenderName));
throw new ArgumentNullException("Не указана почта", nameof(model.SenderName));
}
if (string.IsNullOrEmpty(model.Subject))
{

View File

@ -37,8 +37,7 @@ namespace GarmentFactoryBusinessLogic.MailWorker
public async void MailSendAsync(MailSendInfoBindingModel info)
{
if (string.IsNullOrEmpty(_mailLogin) ||
string.IsNullOrEmpty(_mailPassword))
if (string.IsNullOrEmpty(_mailLogin) || string.IsNullOrEmpty(_mailPassword))
{
return;
}
@ -46,20 +45,17 @@ namespace GarmentFactoryBusinessLogic.MailWorker
{
return;
}
if (string.IsNullOrEmpty(info.MailAddress) ||
string.IsNullOrEmpty(info.Subject) || string.IsNullOrEmpty(info.Text))
if (string.IsNullOrEmpty(info.MailAddress) || string.IsNullOrEmpty(info.Subject) || string.IsNullOrEmpty(info.Text))
{
return;
}
_logger.LogDebug("Send Mail: {To}, {Subject}", info.MailAddress,
info.Subject);
_logger.LogDebug("Send Mail: {To}, {Subject}", info.MailAddress, info.Subject);
await SendMailAsync(info);
}
public async void MailCheck()
{
if (string.IsNullOrEmpty(_mailLogin) ||
string.IsNullOrEmpty(_mailPassword))
if (string.IsNullOrEmpty(_mailLogin) || string.IsNullOrEmpty(_mailPassword))
{
return;
}

View File

@ -8,7 +8,7 @@
<div class="text-center">
<h1 class="display-4">Заказы</h1>
<h1 class="display-4">Письма</h1>
</div>

View File

@ -26,7 +26,7 @@
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Mails">Письма</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Mails">Письма</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>

View File

@ -43,6 +43,7 @@ namespace GarmentFactoryContracts.ViewModels
[DisplayName("Дата выполнения")]
public DateTime? DateComplete { get; set; }
[DisplayName("Почта клиента")]
public string ClientEmail { get; set; } = string.Empty;
}
}

View File

@ -38,6 +38,7 @@ namespace GarmentFactoryDatabaseImplement.Implements
using var context = new GarmentFactoryDatabase();
return context.Clients.FirstOrDefault(x =>
(!string.IsNullOrEmpty(model.Email) && x.Email == model.Email && !string.IsNullOrEmpty(model.Password) && x.Password == model.Password) ||
(!string.IsNullOrEmpty(model.Email) && x.Email == model.Email && string.IsNullOrEmpty(model.Password)) ||
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}

View File

@ -46,7 +46,6 @@ namespace GarmentFactoryDatabaseImplement.Models
DateDelivery = model.DateDelivery,
Subject = model.Subject,
Body = model.Body,
};
}

View File

@ -11,6 +11,6 @@
"SmtpClientPort": "587",
"PopHost": "pop.gmail.com",
"PopPort": "995",
"MailLogin": "ujijrujijr@gmail.com",
"MailPassword": "twkn exbj fkua jrlw"
"MailLogin": "rpplab7chernyshev@gmail.com",
"MailPassword": "cojg axan axbk qtqb"
}