Továbbfejlesztés

This commit is contained in:
2025-04-04 12:42:47 +02:00
parent de8b95eda1
commit 5b1f7fb642
15 changed files with 1130 additions and 164 deletions
+2
View File
@@ -14,6 +14,8 @@ namespace WorkFlowCheck.Common.DTO
public string UserName { get;set; } = null!; public string UserName { get;set; } = null!;
public string Password { get; set; } public string Password { get; set; }
public string JwtToken { get; set; } = null!; public string JwtToken { get; set; } = null!;
public bool Active { get; set; }
public bool NFCActive { get; set; }
public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>(); public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>();
} }
} }
+6 -2
View File
@@ -132,7 +132,9 @@ namespace WorkFlowCheck.DL
LastModBy = "System", LastModBy = "System",
JwtToken = "", JwtToken = "",
Active = true, Active = true,
Token2FA = "" Token2FA = "",
NFCActive = true,
NFCCode = "00000000"
}, },
new User new User
{ {
@@ -149,7 +151,9 @@ namespace WorkFlowCheck.DL
LastModBy = "System", LastModBy = "System",
JwtToken = "", JwtToken = "",
Active = true, Active = true,
Token2FA = "" Token2FA = "",
NFCActive = true,
NFCCode = "00000000"
} }
); );
modelBuilder.Entity<NumberGeneratorTemplate>().HasData( modelBuilder.Entity<NumberGeneratorTemplate>().HasData(
+2
View File
@@ -14,6 +14,8 @@ namespace WorkFlowCheck.DL.Entities
public string JwtToken { get; set; } = null!; public string JwtToken { get; set; } = null!;
public string Token2FA { get; set; } = null!; public string Token2FA { get; set; } = null!;
public bool Active { get; set; } public bool Active { get; set; }
public bool NFCActive { get; set; }
public string NFCCode { get; set; } = null!;
public virtual ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>(); public virtual ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
@@ -0,0 +1,861 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250404104148_Extend013")]
partial class Extend013
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,69 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend013 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "NFCActive",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "NFCCode",
table: "Users",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt", "NFCActive", "NFCCode" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578), new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580), true, "00000000" });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt", "NFCActive", "NFCCode" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896), new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897), true, "00000000" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NFCActive",
table: "Users");
migrationBuilder.DropColumn(
name: "NFCCode",
table: "Users");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5537), new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5540) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9369), new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9370) });
}
}
}
@@ -591,6 +591,13 @@ namespace WorkFlowCheck.DL.Migrations
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash") b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@@ -611,15 +618,17 @@ namespace WorkFlowCheck.DL.Migrations
{ {
Id = 1, Id = 1,
Active = true, Active = true,
CreatedAt = new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5537), CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578),
CreatedBy = "System", CreatedBy = "System",
Email = "admin@nuvolar.hu", Email = "admin@nuvolar.hu",
FirstName = "Administrator", FirstName = "Administrator",
IsDeleted = false, IsDeleted = false,
JwtToken = "", JwtToken = "",
LastModAt = new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5540), LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580),
LastModBy = "System", LastModBy = "System",
LastName = "System", LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY", PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "", Token2FA = "",
UserName = "admin" UserName = "admin"
@@ -628,15 +637,17 @@ namespace WorkFlowCheck.DL.Migrations
{ {
Id = 2, Id = 2,
Active = true, Active = true,
CreatedAt = new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9369), CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896),
CreatedBy = "System", CreatedBy = "System",
Email = "user@nuvolar.hu", Email = "user@nuvolar.hu",
FirstName = "User", FirstName = "User",
IsDeleted = false, IsDeleted = false,
JwtToken = "", JwtToken = "",
LastModAt = new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9370), LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897),
LastModBy = "System", LastModBy = "System",
LastName = "System", LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG", PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "", Token2FA = "",
UserName = "user" UserName = "user"
@@ -136,42 +136,43 @@
formData.CheckPointDTO.CheckListTemplateRowDTO = []; formData.CheckPointDTO.CheckListTemplateRowDTO = [];
formData.CheckPointDTO.IsEnabled = $('#CheckPointDTO_IsEnabled').is(':checked'); formData.CheckPointDTO.IsEnabled = $('#CheckPointDTO_IsEnabled').is(':checked');
$.ajax({ saveEntity(csrfToken, formData.CheckPointDTO, $('#checkPointEditPostUrl').val());
url: $('#checkPointEditPostUrl').val(),
type: 'POST', // $.ajax({
headers: { // url: $('#checkPointEditPostUrl').val(),
'X-CSRF-TOKEN': csrfToken, // type: 'POST',
'Content-Type': 'application/json' // headers: {
}, // 'X-CSRF-TOKEN': csrfToken,
data: JSON.stringify(formData.CheckPointDTO), // 'Content-Type': 'application/json'
success: function (response) { // },
if (response.success) // data: JSON.stringify(formData.CheckPointDTO),
{ // success: function (response) {
showMessageModal({ // if (response.success)
title: 'Figyelmem!', // {
message: 'Sikeres mentés.', // showMessageModal({
okText: 'Értettem' // title: 'Figyelmem!',
}); // message: 'Sikeres mentés.',
} // okText: 'Értettem'
else // });
{ // }
showMessageModal({ // else
title: 'Figyelmem, HIBA!', // {
message: 'Sikertelen mentés.', // showMessageModal({
okText: 'Értettem' // title: 'Figyelmem, HIBA!',
}); // message: 'Sikertelen mentés.',
} // okText: 'Értettem'
}, // });
error: function (xhr, status, error) { // }
// Hiba esetén // },
console.error("Hiba: ", error); // error: function (xhr, status, error) {
showMessageModal({ // console.error("Hiba: ", error);
title: 'Hiba!', // showMessageModal({
message: 'A mentés NEM sikerült!', // title: 'Hiba!',
okText: 'Értettem' // message: 'A mentés NEM sikerült!',
}); // okText: 'Értettem'
} // });
}); // }
// });
}); });
@@ -44,31 +44,7 @@
if ($form.valid()) if ($form.valid())
{ {
$.ajax({ saveEntity(csrfToken, formData.EquipmentDTO, $('#EquipmentEditPostUrl').val());
url: $('#EquipmentEditPostUrl').val(),
type: 'POST',
headers: {
'X-CSRF-TOKEN': csrfToken,
'Content-Type': 'application/json'
},
data: JSON.stringify(formData.EquipmentDTO),
success: function (response) {
showMessageModal({
title: 'Figyelmem!',
message: 'Sikeres mentés.',
okText: 'Értettem'
});
},
error: function (xhr, status, error) {
// Hiba esetén
console.error("Hiba: ", error);
showMessageModal({
title: 'Hiba!',
message: 'A mentés NEM sikerült!',
okText: 'Értettem'
});
}
});
} else } else
{ {
$form[0].reportValidity(); $form[0].reportValidity();
@@ -77,17 +77,7 @@
$('#tbEquipmentsPage').on('click', '.delete-btn', function () $('#tbEquipmentsPage').on('click', '.delete-btn', function ()
{ {
const row = table.row($(this).closest('tr')).data(); const row = table.row($(this).closest('tr')).data();
console.log(row); deleteEntity(table, '/BaseStock/Equipments/EquipmentPage?handler=DeleteLocation', row.id);
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function(result) {
if(result === 'ok') {
console.log('Törlés végrehajtva');
}
});
}); });
</script> </script>
} }
@@ -23,5 +23,10 @@ namespace WorkFlowCheck.Web.Pages.BaseStock.Equipments
var results = await _baseStockService.GetAllEquipments(); var results = await _baseStockService.GetAllEquipments();
return new JsonResult(new { data = results }); return new JsonResult(new { data = results });
} }
public async Task<JsonResult> OnGetDeleteEquipment(int id)
{
var isSuccess = await _baseStockService.DeleteEquipment(id);
return new JsonResult(new { result = isSuccess });
}
} }
} }
@@ -35,46 +35,9 @@
var formData = getFormAsNestedObject('#LocationForm'); var formData = getFormAsNestedObject('#LocationForm');
const $form = $('#LocationForm'); const $form = $('#LocationForm');
console.log(formData.Location);
if ($form.valid()) if ($form.valid())
{ {
$.ajax({ saveEntity(csrfToken, formData.LocationDTO, $('#LocationEditPostUrl').val());
url: $('#LocationEditPostUrl').val(),
type: 'POST',
headers: {
'X-CSRF-TOKEN': csrfToken,
'Content-Type': 'application/json'
},
data: JSON.stringify(formData.LocationDTO),
success: function (response) {
if (response.success)
{
showMessageModal({
title: 'Figyelmem!',
message: 'Sikeres mentés.',
okText: 'Értettem'
});
}
else
{
showMessageModal({
title: 'Figyelmem, HIBA!',
message: 'Sikertelen mentés.',
okText: 'Értettem'
});
}
},
error: function (xhr, status, error) {
// Hiba esetén
console.error("Hiba: ", error);
showMessageModal({
title: 'Hiba!',
message: 'A mentés NEM sikerült!',
okText: 'Értettem'
});
}
});
} else } else
{ {
$form[0].reportValidity(); $form[0].reportValidity();
@@ -73,46 +73,9 @@
$('#tbLocationsPage').on('click', '.delete-btn', function () $('#tbLocationsPage').on('click', '.delete-btn', function ()
{ {
const row = table.row($(this).closest('tr')).data(); var row = table.row($(this).closest('tr')).data();
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function(result) {
if(result === 'ok') {
$.ajax({
url: '/BaseStock/Locations/LocationsPage?handler=DeleteLocation',
type: 'GET',
data: { id: row.id },
success: function (data) {
console.log(data);
if (data) {
showMessageModal({
title: 'Információ',
message: 'A törlés sikerült!',
okText: 'Értettem'
});
table.ajax.reload(); deleteEntity(table, '/BaseStock/Locations/LocationsPage?handler=DeleteLocation', row.id);
} else {
showMessageModal({
title: 'Hiba!',
message: 'A törlés NEM sikerült!',
okText: 'Értettem'
});
}
},
error: function (xhr, status, error) {
showMessageModal({
title: 'Hiba!',
message: 'A törlés NEM sikerült!',
okText: 'Értettem'
});
}
});
}
});
}); });
</script> </script>
} }
@@ -165,6 +165,48 @@ namespace WorkFlowCheck.Web.Services
} }
return retVal; return retVal;
} }
public async Task<bool> DeleteEquipment(int id)
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/DeleteEquipment/{id}";
var retVal = false;
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> DeleteCheckPoint(int id)
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/DeleteCheckPoint/{id}";
var retVal = false;
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPointDTO) public async Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPointDTO)
{ {
@@ -7,12 +7,13 @@ namespace WorkFlowCheck.Web.Services.Interfaces
{ {
Task<CheckPointDTO> GetCheckPoint(int id); Task<CheckPointDTO> GetCheckPoint(int id);
//Task<bool> DeleteCheckpoint(int id); Task<bool> DeleteCheckpoint(int id);
Task<List<CheckPointDTO>> GetAllCheckPoints(); Task<List<CheckPointDTO>> GetAllCheckPoints();
Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPointDTO); Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPointDTO);
Task<EquipmentDTO> GetEquipment(int id); Task<EquipmentDTO> GetEquipment(int id);
Task<bool> EquipmentLocation(int id);
Task<List<EquipmentDTO>> GetAllEquipments(); Task<List<EquipmentDTO>> GetAllEquipments();
Task<ApiResponseDTO<EquipmentDTO>> UpdateEquipment(EquipmentDTO equipmentDTO); Task<ApiResponseDTO<EquipmentDTO>> UpdateEquipment(EquipmentDTO equipmentDTO);
+76
View File
@@ -222,3 +222,79 @@ function renderAnswerPhoto(data, row) {
} }
return `<div class="text-center">${data}</div></div>`; return `<div class="text-center">${data}</div></div>`;
} }
//Törlési funkció adatbázisnál
function deleteEntity(table, url, entityid) {
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function (result) {
if (result === 'ok') {
$.ajax({
url: url,
type: 'GET',
data: { id: entityid },
success: function (data) {
if (data) {
showMessageModal({
title: 'Információ',
message: 'A törlés sikerült!',
okText: 'Értettem'
});
table.ajax.reload();
} else {
showMessageModal({
title: 'Hiba!',
message: 'A törlés NEM sikerült!',
okText: 'Értettem'
});
}
},
error: function (xhr, status, error) {
showMessageModal({
title: 'Hiba!',
message: 'A törlés NEM sikerült!',
okText: 'Értettem'
});
}
});
}
});
}
function saveEntity(csrfToken, data, url) {
$.ajax({
url: url,
type: 'POST',
headers: {
'X-CSRF-TOKEN': csrfToken,
'Content-Type': 'application/json'
},
data: JSON.stringify(data),
success: function (response) {
if (response.success) {
showMessageModal({
title: 'Figyelmem!',
message: 'Sikeres mentés.',
okText: 'Értettem'
});
}
else {
showMessageModal({
title: 'Figyelmem, HIBA!',
message: 'Sikertelen mentés.',
okText: 'Értettem'
});
}
},
error: function (xhr, status, error) {
console.error("Hiba: ", error);
showMessageModal({
title: 'Hiba!',
message: 'A mentés NEM sikerült!',
okText: 'Értettem'
});
}
});
}