lab-7 it is work

This commit is contained in:
Zakharov_Rostislav 2024-05-08 17:37:59 +04:00
parent 0cda93cbb4
commit fd47809498
3 changed files with 12 additions and 6 deletions

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="r.for.labs@gmail.com" />
<add key="MailPassword" value="jouu dcra gclx keup" />
<add key="MailLogin" value="forlabspibd23@gmail.com" />
<add key="MailPassword" value="euby honk jvrl rrjj" />
</appSettings>
</configuration>

View File

@ -69,7 +69,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
_logger.LogWarning("Insert operation failed");
return false;
}
SendOrderStatusMail(model.ClientId, $"Изменен статус заказа #{res.Id}", $"Заказ #{res.Id} изменен статус на {model.Status}");
SendOrderStatusMail(res.ClientId, $"Изменен статус заказа #{res.Id}", $"Заказ #{res.Id} изменен статус на {model.Status}");
return true;
}
private bool SendOrderStatusMail(int clientId, string subject, string text)
@ -106,7 +106,13 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
model.DateImplement = DateTime.Now;
if (element.ImplementerId.HasValue)
model.ImplementerId = element.ImplementerId;
_orderStorage.Update(model);
var result = _orderStorage.Update(model);
if (result == null)
{
_logger.LogWarning("Update operation failed");
return false;
}
SendOrderStatusMail(result.ClientId, $"Изменен статус заказа #{result.Id}", $"Заказ #{result.Id} изменен статус на {result.Status}");
return true;
}
public bool TakeOrderInWork(OrderBindingModel model)

View File

@ -10,6 +10,6 @@
"SmtpClientPort": "587",
"PopHost": "pop.gmail.com",
"PopPort": "995",
"MailLogin": "r.for.labs@gmail.com",
"MailPassword": "jouu dcra gclx keup"
"MailLogin": "forlabspibd23@gmail.com",
"MailPassword": "euby honk jvrl rrjj"
}