IsEnabled a CheckPoint-hoz
This commit is contained in:
@@ -87,6 +87,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
{
|
||||
res.ShortName = checkPointDTO.ShortName;
|
||||
res.Code = checkPointDTO.Code;
|
||||
res.IsEnabled = checkPointDTO.IsEnabled;
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public string Code { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
public List<CheckListTemplateRowDTO>? CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public int Id { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public string Code { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime LastModAt { get; set; }
|
||||
public string LastModBy { get; set; } = null!;
|
||||
|
||||
@@ -0,0 +1,850 @@
|
||||
// <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("20250331112123_Extend010")]
|
||||
partial class Extend010
|
||||
{
|
||||
/// <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<byte[]>("Photo")
|
||||
.IsRequired()
|
||||
.HasColumnType("varbinary(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<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, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939),
|
||||
CreatedBy = "System",
|
||||
Email = "admin@nuvolar.hu",
|
||||
FirstName = "Administrator",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
|
||||
Token2FA = "",
|
||||
UserName = "admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859),
|
||||
CreatedBy = "System",
|
||||
Email = "user@nuvolar.hu",
|
||||
FirstName = "User",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
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,58 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Extend010 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsEnabled",
|
||||
table: "CheckPoint",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939), new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942) });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859), new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860) });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsEnabled",
|
||||
table: "CheckPoint");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914), new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918) });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281), new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285) });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,6 +266,9 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("LastModAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -608,13 +611,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914),
|
||||
CreatedAt = new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939),
|
||||
CreatedBy = "System",
|
||||
Email = "admin@nuvolar.hu",
|
||||
FirstName = "Administrator",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918),
|
||||
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
|
||||
@@ -625,13 +628,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281),
|
||||
CreatedAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859),
|
||||
CreatedBy = "System",
|
||||
Email = "user@nuvolar.hu",
|
||||
FirstName = "User",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285),
|
||||
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
<input asp-for="CheckPoint.Code" class="form-control" />
|
||||
<span asp-validation-for="CheckPoint.Code" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="CheckPoint.IsEnabled"></label>
|
||||
<input type="checkbox" asp-for="CheckPoint.IsEnabled" class="form-check-input" />
|
||||
<span asp-validation-for="CheckPoint.IsEnabled" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<button type="button" id="saveCheckPoint" class="btn btn-primary">Mentés</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="history.back()">Mégsem</button>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Short Name</th>
|
||||
<th>Enabled</th>
|
||||
<th>Code</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
@@ -23,6 +23,7 @@
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Enabled</th>
|
||||
<th>Short Name</th>
|
||||
<th>Code</th>
|
||||
<th>Action</th>
|
||||
@@ -41,6 +42,22 @@
|
||||
},
|
||||
columns: [
|
||||
{ data: "id" },
|
||||
{
|
||||
data: "isEnabled",
|
||||
searchable: false,
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" >';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
},
|
||||
{ data: "shortName" },
|
||||
{ data: "code" },
|
||||
{ data: null, render: function (data, type, row) {
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<li><hr class="dropdown-divider"></li> <!-- EZ AZ ELVÁLASZTÓ VONAL -->
|
||||
<li><a class="dropdown-item" asp-area="" asp-page="/UserAndRole/UserRolePage">Felhasználók - szabályok</a></li>
|
||||
<li><a class="dropdown-item" asp-area="" asp-page="/UserAndRole/RoleCheckListTemplateHeadersPage">Szabályok - Ellenőrzési sablonok</a></li>
|
||||
<li><a class="dropdown-item" asp-area="" asp-page="/UserAndRole/RoleCheckPointsPage">Szabályok - Ellenőrzési pontok</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
@@ -151,7 +152,6 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@4.0.0/dist/jquery.validate.unobtrusive.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
|
||||
@* <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> *@
|
||||
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
<partial name="_ValidationScriptsPartial" />
|
||||
|
||||
@@ -46,19 +46,19 @@
|
||||
{ data: "roleDTO.roleName" },
|
||||
{ data: "checkListTemplateHeaderDTO.description" },
|
||||
{
|
||||
data: "enabled",
|
||||
searchable: false,
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="editor-active" disabled checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="editor-active" disabled>';
|
||||
}
|
||||
return data;
|
||||
data: "enabled",
|
||||
searchable: false,
|
||||
sortable: false,
|
||||
className: "text-center",
|
||||
render: function ( data, type, row ) {
|
||||
if (data === true) {
|
||||
return '<input type="checkbox" class="form-check-input no-click" checked>';
|
||||
}
|
||||
if (data === false) {
|
||||
return '<input type="checkbox" class="form-check-input no-click">';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
},
|
||||
{ data: null, render: function (data, type, row) {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
@page
|
||||
@model WorkFlowCheck.Web.Pages.UserAndRole.RoleCheckPointEditPageModel
|
||||
@using Microsoft.AspNetCore.Antiforgery
|
||||
@inject IAntiforgery Antiforgery
|
||||
@{
|
||||
ViewData["Title"] = "Ellenőrzési pont";
|
||||
var RoleCheckPointId = Model.RoleCheckPointDTO.Id;
|
||||
var urlPost = Url.Page("./RoleCheckPointEditPage", "Save");
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<input type="hidden" id="RoleCheckPointEditPostUrl" value="@urlPost" />
|
||||
|
||||
<div class="card shadow p-4">
|
||||
<form method="post" id="RoleCheckPointForm">
|
||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||
<input type="hidden" asp-for="RoleCheckPointDTO.Id" />
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="col-md-3">
|
||||
<label asp-for="RoleCheckPointDTO.RoleId"></label>
|
||||
<select asp-for="RoleCheckPointDTO.RoleId" class="form-control" asp-items="Model.Roles"></select>
|
||||
<span asp-validation-for="RoleCheckPointDTO.RoleId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="RoleCheckPointDTO.CheckPointId"></label>
|
||||
<select asp-for="RoleCheckPointDTO.CheckPointId" class="form-control" asp-items="Model.RoleCheckPoints"></select>
|
||||
<span asp-validation-for="RoleCheckPointDTO.CheckPointId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="RoleCheckPointDTO.Enabled"></label>
|
||||
<input type="checkbox" asp-for="RoleCheckPointDTO.Enabled" class="form-check-input" />
|
||||
<span asp-validation-for="RoleCheckPointDTO.Enabled" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 d-flex justify-content-between">
|
||||
<button type="button" id="saveRoleCheckPoint" class="btn btn-primary">Mentés</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="history.back()">Mégsem</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
|
||||
$("#saveRoleCheckPoint").click(function () {
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||
var formData = getFormAsNestedObject('#RoleCheckPointForm');
|
||||
const $form = $('#RoleCheckPointForm');
|
||||
formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointForm input[name="RoleCheckPointDTO.Enabled"]').is(':checked');
|
||||
|
||||
// console.log(formData);
|
||||
console.log(formData.RoleCheckPointDTO);
|
||||
|
||||
if ($form.valid())
|
||||
{
|
||||
$.ajax({
|
||||
url: $('#RoleCheckPointEditPostUrl').val(),
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: JSON.stringify(formData.RoleCheckPointDTO),
|
||||
success: function (response) {
|
||||
// console.log(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
|
||||
{
|
||||
$form[0].reportValidity();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
const $form = $("#RoleCheckPointForm");
|
||||
|
||||
$form.validate({
|
||||
errorClass: "text-danger small",
|
||||
errorPlacement: function (error, element) {
|
||||
error.appendTo(element.parent());
|
||||
}
|
||||
});
|
||||
|
||||
// $form.on("submit", function (e) {
|
||||
// if (!$form.valid()) {
|
||||
// e.preventDefault(); // Ne küldje be, ha van hiba
|
||||
// }
|
||||
// });
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Serilog;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Web.Services;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
{
|
||||
public class RoleCheckPointEditPageModel : PageModel
|
||||
{
|
||||
private readonly ILogger<IndexModel> _logger;
|
||||
private readonly IUserService _userService;
|
||||
private readonly IBaseStockService _baseStockService;
|
||||
|
||||
[BindProperty]
|
||||
public RoleCheckPointDTO RoleCheckPointDTO { get; set; } = new();
|
||||
|
||||
[BindProperty]
|
||||
public List<SelectListItem> Roles { get; set; }
|
||||
|
||||
[BindProperty]
|
||||
public List<SelectListItem> RoleCheckPoints { get; set; }
|
||||
|
||||
public RoleCheckPointEditPageModel(ILogger<IndexModel> logger, IUserService userService, IBaseStockService baseStockService)
|
||||
{
|
||||
_logger = logger;
|
||||
_userService = userService;
|
||||
_baseStockService = baseStockService;
|
||||
}
|
||||
|
||||
public async Task OnGet(int id)
|
||||
{
|
||||
await InitSelectItems();
|
||||
RoleCheckPointDTO = await _userService.GetRoleCheckPoint(id);
|
||||
}
|
||||
public async Task<IActionResult> OnPostSave([FromBody] RoleCheckPointDTO roleCheckPointDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await _userService.UpdateRoleCheckPoint(roleCheckPointDTO);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return new JsonResult(new { success = true });
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new { success = false });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return new JsonResult(new { success = false });
|
||||
}
|
||||
private async Task InitSelectItems()
|
||||
{
|
||||
var roles = await _userService.GetAllRoles();
|
||||
this.Roles = new List<SelectListItem>();
|
||||
foreach (var role in roles)
|
||||
{
|
||||
this.Roles.Add(new SelectListItem() { Value = role.Id.ToString(), Text = role.RoleName });
|
||||
}
|
||||
var CheckPoints = await _baseStockService.GetAllCheckPoints();
|
||||
this.RoleCheckPoints = new List<SelectListItem>();
|
||||
foreach (var CheckPoint in CheckPoints)
|
||||
{
|
||||
this.RoleCheckPoints.Add(new SelectListItem() { Value = CheckPoint.Id.ToString(), Text = CheckPoint.ShortName });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
}
|
||||
public async Task<JsonResult> OnGetLoadRoleCheckPoints()
|
||||
{
|
||||
var results = await _userService.GetAllRoleCheckListTemplates();
|
||||
var results = await _userService.GetAllRoleCheckPoints();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,7 @@ html {
|
||||
body {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.no-click {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user