lab6
This commit is contained in:
parent
ada93c8c0a
commit
26094e7ed8
@ -50,6 +50,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
||||
_logger.LogInformation("ReadElement. FIO:{FIO}.Id:{ Id}",
|
||||
model.ImplementerFIO, model.Id);
|
||||
var element = _implementerStorage.GetElement(model);
|
||||
|
||||
if (element == null)
|
||||
{
|
||||
_logger.LogWarning("ReadElement element not found");
|
||||
|
@ -37,7 +37,9 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
||||
_logger.LogWarning("DoWork. Orders is null or empty");
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.LogDebug("DoWork for {Count} orders", orders.Count);
|
||||
|
||||
foreach (var implementer in implementers)
|
||||
{
|
||||
Task.Run(() => WorkerWorkAsync(implementer, orders));
|
||||
@ -68,6 +70,7 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
||||
|
||||
Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count);
|
||||
_logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id);
|
||||
|
||||
_orderLogic.DeliveryOrder(new OrderBindingModel
|
||||
{
|
||||
Id = order.Id
|
||||
@ -98,7 +101,6 @@ namespace SoftwareInstallationBusinessLogic.BusinessLogic
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
var runOrder = await Task.Run(() => allOrders.FirstOrDefault(x => x.ImplementerId == implementer.Id && x.Status == OrderStatus.Выполняется));
|
||||
if (runOrder == null)
|
||||
{
|
||||
|
@ -12,8 +12,8 @@ using SoftwareInstallationDataBaseImplement;
|
||||
namespace SoftwareInstallationDataBaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(SoftwareInstallationDataBase))]
|
||||
[Migration("20230410192808_CreateBD")]
|
||||
partial class CreateBD
|
||||
[Migration("20230411045909_CreateDB")]
|
||||
partial class CreateDB
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace SoftwareInstallationDataBaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CreateBD : Migration
|
||||
public partial class CreateDB : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -9,7 +9,7 @@ namespace SoftwareInstallationDataBaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-VG5USAH\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=COMP-AVZH\SQLEXPRESS;Initial Catalog=SoftwareInstallationDataBaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user