TemporaryClientRegister - migration
This commit is contained in:
9083
CompanyManagment.EFCore/Migrations/20250408125553_WorkshopTempAndWorkshopServicetemp.Designer.cs
generated
Normal file
9083
CompanyManagment.EFCore/Migrations/20250408125553_WorkshopTempAndWorkshopServicetemp.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class WorkshopTempAndWorkshopServicetemp : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WorkshopTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkshopName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
|
||||
CountPerson = table.Column<int>(type: "int", nullable: false),
|
||||
ContractingPartyTempId = table.Column<long>(type: "bigint", nullable: false),
|
||||
WorkshopServicesAmount = table.Column<double>(type: "float", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WorkshopTemps", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WorkshopServicesTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ServiceName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||||
CountPerson = table.Column<int>(type: "int", nullable: false),
|
||||
WorkshopTempId = table.Column<long>(type: "bigint", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WorkshopServicesTemps", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_WorkshopServicesTemps_WorkshopTemps_WorkshopTempId",
|
||||
column: x => x.WorkshopTempId,
|
||||
principalTable: "WorkshopTemps",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkshopServicesTemps_WorkshopTempId",
|
||||
table: "WorkshopServicesTemps",
|
||||
column: "WorkshopTempId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "WorkshopServicesTemps");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "WorkshopTemps");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4887,6 +4887,63 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<int>("CountPerson")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("ServiceName")
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("nvarchar(40)");
|
||||
|
||||
b.Property<long>("WorkshopTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("WorkshopTempId");
|
||||
|
||||
b.ToTable("WorkshopServicesTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<long>("ContractingPartyTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("CountPerson")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("WorkshopName")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<double>("WorkshopServicesAmount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("WorkshopTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TextManagerAgg.EntityTextManager", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -8566,6 +8623,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp")
|
||||
.WithMany("WorkshopServicesTemps")
|
||||
.HasForeignKey("WorkshopTempId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WorkshopTemp");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.WorkHistory.WorkHistory", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.Petition.Petition", "Petition")
|
||||
@@ -8931,6 +8999,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Navigation("WorkshopServicesTemps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TextManagerAgg.EntityTextManager", b =>
|
||||
{
|
||||
b.Navigation("EntityModuleTextManagers");
|
||||
|
||||
@@ -17,6 +17,7 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp)
|
||||
{
|
||||
var result = await _context.WorkshopTemps
|
||||
@@ -38,4 +39,24 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<CreateWorkshopTemp> command)
|
||||
//{
|
||||
// var op = new OperationResult();
|
||||
// if (command.Count == 0)
|
||||
// return op.Failed("هیچ مجموعه ای ایجاد نشده است");
|
||||
// foreach (var workshop in command)
|
||||
// {
|
||||
// if(!string.IsNullOrWhiteSpace(workshop.WorkshopName))
|
||||
// return op.Failed("نام مجموعه نمیتواند خالی باشد");
|
||||
// if (workshop.CountPerson == 0)
|
||||
// op.Failed($"تعداد پرسنل مجوعه {workshop.WorkshopName} صفر است");
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// return op.Succcedded();
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user