This commit is contained in:
MahanCh
2025-04-16 15:50:35 +03:30
parent e8efb0a579
commit d52141f729
5 changed files with 1307 additions and 5 deletions

View File

@@ -16,14 +16,14 @@ public class TaskSchedule:EntityBase
UnitType = unitType;
UnitNumber = unitNumber;
LastEndTaskDate = lastEndTaskDate;
IsCanceled = IsActive.True;
IsActive = IsActive.False;
}
public string Count { get; private set; }
public TaskScheduleType Type { get; private set; }
public TaskScheduleUnitType UnitType { get; private set; }
public string UnitNumber { get; private set; }
public DateTime LastEndTaskDate { get; private set; }
public IsActive IsCanceled { get; private set; }
public IsActive IsActive { get; private set; }
public List<Tasks> TasksList { get; set; }
public void SetLastEndTaskDate(DateTime lastEndTaskDate)
@@ -33,6 +33,6 @@ public class TaskSchedule:EntityBase
public void DeActive()
{
IsCanceled = IsActive.False;
IsActive = IsActive.False;
}
}

View File

@@ -15,7 +15,7 @@ public class TaskScheduleMapping : IEntityTypeConfiguration<TaskSchedule>
builder.Property(x => x.Type).HasConversion<string>().HasMaxLength(12);
builder.Property(x => x.UnitNumber).HasMaxLength(10);
builder.Property(x => x.UnitType).HasConversion<string>().HasMaxLength(10);
builder.Property(x => x.IsCanceled).HasConversion<string>().HasMaxLength(5);
builder.Property(x => x.IsActive).HasConversion<string>().HasMaxLength(5);
builder.HasMany(x => x.TasksList).WithOne(x => x.TaskSchedule)
.HasForeignKey(x => x.TaskScheduleId);

View File

@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class taskSchedulerenameisActive : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "IsCanceled",
table: "TaskSchedules",
newName: "IsActive");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "IsActive",
table: "TaskSchedules",
newName: "IsCanceled");
}
}
}

View File

@@ -759,7 +759,7 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsCanceled")
b.Property<string>("IsActive")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");