Compare commits

..

2 Commits

Author SHA1 Message Date
sardq
68bb80e7e9 Merge branch 'main' of https://git.is.ulstu.ru/DavidMakarov/PIbd-21_Makarov_Razubaev_CourseWork 2024-05-30 02:29:59 +04:00
sardq
a1e7ac3211 все?... 2024-05-30 02:29:51 +04:00
6 changed files with 24 additions and 22 deletions

View File

@ -23,4 +23,8 @@
<ProjectReference Include="..\FactoryContracts\FactoryContracts.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

View File

@ -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");

View File

@ -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",

View File

@ -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");

View File

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

View File

@ -14,7 +14,7 @@
<p>
<a asp-action="PlanProduction">Создать план</a>
<a asp-action="ConnectionPlanProductionWorkpiece">Привязка планов производства к заготовкам</a>
<a asp-action="ConnectionPlanProductionWorkpiece">Привязка заготовок к планам производства</a>
</p>
<table class="table">