Merge branch 'main' of https://git.is.ulstu.ru/DavidMakarov/PIbd-21_Makarov_Razubaev_CourseWork
This commit is contained in:
commit
45f2a7cc3b
@ -23,4 +23,8 @@
|
||||
<ProjectReference Include="..\FactoryContracts\FactoryContracts.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
namespace FactoryDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(FactoryDatabase))]
|
||||
[Migration("20240528144223_InitCreate")]
|
||||
partial class InitCreate
|
||||
[Migration("20240529212521_Init")]
|
||||
partial class Init
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
@ -71,7 +71,8 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PlanProductionId")
|
||||
b.Property<int?>("PlanProductionId")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Status")
|
||||
@ -81,8 +82,7 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("PlanProductionId")
|
||||
.IsUnique();
|
||||
b.HasIndex("PlanProductionId");
|
||||
|
||||
b.ToTable("ExecutionPhases");
|
||||
});
|
||||
@ -345,8 +345,8 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FactoryDatabaseImplement.Models.PlanProduction", "PlanProduction")
|
||||
.WithOne("ExecutionPhase")
|
||||
.HasForeignKey("FactoryDatabaseImplement.Models.ExecutionPhase", "PlanProductionId")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlanProductionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@ -518,9 +518,6 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("FactoryDatabaseImplement.Models.PlanProduction", b =>
|
||||
{
|
||||
b.Navigation("ExecutionPhase")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Machines");
|
||||
|
||||
b.Navigation("Workpieces");
|
@ -6,7 +6,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace FactoryDatabaseImplement.Migrations
|
||||
{
|
||||
public partial class InitCreate : Migration
|
||||
public partial class Init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
@ -287,8 +287,7 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ExecutionPhases_PlanProductionId",
|
||||
table: "ExecutionPhases",
|
||||
column: "PlanProductionId",
|
||||
unique: true);
|
||||
column: "PlanProductionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MachinePlanProductions_MachineId",
|
@ -69,7 +69,8 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PlanProductionId")
|
||||
b.Property<int?>("PlanProductionId")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Status")
|
||||
@ -79,8 +80,7 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("PlanProductionId")
|
||||
.IsUnique();
|
||||
b.HasIndex("PlanProductionId");
|
||||
|
||||
b.ToTable("ExecutionPhases");
|
||||
});
|
||||
@ -343,8 +343,8 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FactoryDatabaseImplement.Models.PlanProduction", "PlanProduction")
|
||||
.WithOne("ExecutionPhase")
|
||||
.HasForeignKey("FactoryDatabaseImplement.Models.ExecutionPhase", "PlanProductionId")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlanProductionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@ -516,9 +516,6 @@ namespace FactoryDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("FactoryDatabaseImplement.Models.PlanProduction", b =>
|
||||
{
|
||||
b.Navigation("ExecutionPhase")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Machines");
|
||||
|
||||
b.Navigation("Workpieces");
|
||||
|
@ -302,6 +302,11 @@ namespace FactoryWorkerApp.Controllers
|
||||
DateFrom = startDate,
|
||||
DateTo = endDate,
|
||||
});
|
||||
foreach( var report in reports)
|
||||
{
|
||||
if (report.Machines == null)
|
||||
report.Machines = new();
|
||||
}
|
||||
return View(reports);
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
ViewData["Title"] = "Execution Phase";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Заготовка</h2>
|
||||
<h2 class="display-4">Этап выполнения</h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<p>
|
||||
<a asp-action="PlanProduction">Создать план</a>
|
||||
<a asp-action="ConnectionPlanProductionWorkpiece">Привязка планов производства к заготовкам</a>
|
||||
<a asp-action="ConnectionPlanProductionWorkpiece">Привязка заготовок к планам производства</a>
|
||||
</p>
|
||||
|
||||
<table class="table">
|
||||
|
Loading…
Reference in New Issue
Block a user