RoleCheckPoint
This commit is contained in:
@@ -366,5 +366,80 @@ namespace WorkFlowCheck.API.Controllers
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpGet("GetRoleCheckPoint/{id}")]
|
||||
public async Task<ApiResponseDTO<RoleCheckPointDTO>> GetRoleCheckPoint(int id)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<RoleCheckPointDTO>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var roleCheckPointDTO = await _userService.GetRoleCheckPointAsync(id);
|
||||
|
||||
if (roleCheckPointDTO != null)
|
||||
{
|
||||
if (roleCheckPointDTO.Id == 0)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No match!");
|
||||
retVal.Data = roleCheckPointDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = roleCheckPointDTO;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
[HttpGet("GetAllRoleCheckPoints")]
|
||||
public async Task<ApiResponseDTO<List<RoleCheckPointDTO>>> GetAllRoleCheckPoints()
|
||||
{
|
||||
var retVal = new ApiResponseDTO<List<RoleCheckPointDTO>>()
|
||||
{
|
||||
IsSuccess = true,
|
||||
};
|
||||
var results = await _userService.GetAllRoleCheckPointsAsync();
|
||||
|
||||
if (results != null)
|
||||
{
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = results;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add("No data!");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
[HttpPost("UpdateRoleCheckPoint")]
|
||||
public async Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint([FromBody] RoleCheckPointDTO roleCheckPointDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<RoleCheckPointDTO>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _userService.UpdateRoleCheckPointAsync(roleCheckPointDTO);
|
||||
retVal.Data = result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.BL.DocumentGenerator;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.DL;
|
||||
using WorkFlowCheck.DL.Entities;
|
||||
|
||||
@@ -150,6 +154,7 @@ namespace WorkFlowCheck.BL.Services
|
||||
CheckListHeader checkListHeader = new CheckListHeader()
|
||||
{
|
||||
CheckListTemplateHeaderId = checkListHeaderNewDTO.CheckListTemplateHeaderId,
|
||||
CheckStatus = CheckStatus.Open,
|
||||
DateExecution = currentDate,
|
||||
IsEditable = true,
|
||||
UserId = checkListHeaderNewDTO.UserId,
|
||||
@@ -417,7 +422,6 @@ namespace WorkFlowCheck.BL.Services
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
public byte[] CreatePDF(int checkListHeaderId)
|
||||
{
|
||||
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
@@ -26,6 +22,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
Task<CheckListRowDTO> GetCheckListRowAsync(int id);
|
||||
Task<CheckListRowDTO> UpdateCheckListRowAsync(CheckListRowDTO checkListRowDTO);
|
||||
|
||||
|
||||
byte[] CreatePDF(int checkListHeaderId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplateHeadersAsync();
|
||||
Task<RoleCheckListTemplateHeaderDTO> UpdateRoleCheckListTemplateHeaderAsync(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO);
|
||||
|
||||
Task<RoleCheckPointDTO> GetRoleCheckPointAsync(int Id);
|
||||
Task<List<RoleCheckPointDTO>> GetAllRoleCheckPointsAsync();
|
||||
Task<RoleCheckPointDTO> UpdateRoleCheckPointAsync(RoleCheckPointDTO roleCheckPointDTO);
|
||||
|
||||
string GenerateJwtToken(UserDTO userDTO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,5 +429,95 @@ namespace WorkFlowCheck.BL.Services
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleCheckPointDTO> GetRoleCheckPointAsync(int Id)
|
||||
{
|
||||
var retVal = new RoleCheckPointDTO();
|
||||
|
||||
try
|
||||
{
|
||||
var userRole = await _dbContext.RoleCheckPoints.Where(w => w.Id == Id).FirstOrDefaultAsync();
|
||||
if (userRole != null)
|
||||
{
|
||||
retVal = _mapper.Map<RoleCheckPointDTO>(userRole);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<List<RoleCheckPointDTO>> GetAllRoleCheckPointsAsync()
|
||||
{
|
||||
var retVal = new List<RoleCheckPointDTO>();
|
||||
try
|
||||
{
|
||||
var results = await _dbContext.RoleCheckPoints
|
||||
.Include(i => i.CheckPoint)
|
||||
.Include(i => i.Role)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
if (results != null)
|
||||
{
|
||||
retVal = _mapper.Map<List<RoleCheckPointDTO>>(results);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<RoleCheckPointDTO> UpdateRoleCheckPointAsync(RoleCheckPointDTO roleCheckPointDTO)
|
||||
{
|
||||
var retVal = new RoleCheckPointDTO();
|
||||
try
|
||||
{
|
||||
if (roleCheckPointDTO.Id == 0)
|
||||
{
|
||||
var roleCheckPoint_Exists = await _dbContext.RoleCheckPoints
|
||||
.Where(w => w.RoleId == roleCheckPointDTO.RoleId &&
|
||||
w.CheckPointId == roleCheckPointDTO.CheckPointId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (roleCheckPoint_Exists == null)
|
||||
{
|
||||
var roleCheckPoint = new RoleCheckPoint();
|
||||
roleCheckPoint.CheckPointId = roleCheckPointDTO.CheckPointId;
|
||||
roleCheckPoint.RoleId = roleCheckPointDTO.RoleId;
|
||||
roleCheckPoint.Enabled = roleCheckPointDTO.Enabled;
|
||||
|
||||
_dbContext.RoleCheckPoints.Add(roleCheckPoint);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint_Exists);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var roleCheckPoint = await _dbContext.RoleCheckPoints.Where(w => w.Id == roleCheckPointDTO.Id).FirstOrDefaultAsync();
|
||||
|
||||
if (roleCheckPoint != null)
|
||||
{
|
||||
roleCheckPoint.CheckPointId = roleCheckPointDTO.CheckPointId;
|
||||
roleCheckPoint.RoleId = roleCheckPointDTO.RoleId;
|
||||
roleCheckPoint.Enabled = roleCheckPointDTO.Enabled;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
@@ -11,6 +12,7 @@ namespace WorkFlowCheck.Common.DTO
|
||||
public int Id { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public CheckListTemplateHeaderDTO? CheckListTemplateHeaderDTO { get; set; }
|
||||
public CheckStatus CheckStatus { get; set; }
|
||||
public DateTime DateExecution { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public UserDTO? UserDTO { get; set; }
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.Common.DTO
|
||||
{
|
||||
public class RoleCheckPointDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int RoleId { get; set; }
|
||||
public RoleDTO? RoleDTO { get; set; } = null!;
|
||||
public int CheckPointId { get; set; }
|
||||
public CheckPointDTO? CheckPointDTO { get; set; } = null!;
|
||||
public bool Enabled { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.Common.Enums
|
||||
{
|
||||
public enum CheckStatus
|
||||
{
|
||||
Open = 0,
|
||||
InProgress = 1,
|
||||
Blocked = 3,
|
||||
Storno = 4,
|
||||
Sent = 5
|
||||
}
|
||||
}
|
||||
@@ -44,8 +44,8 @@ namespace WorkFlowCheck.DL
|
||||
public DbSet<Entities.Role> Roles { get; set; } = null!;
|
||||
public DbSet<Entities.User> Users { get; set; } = null!;
|
||||
public DbSet<Entities.UserRole> UserRoles { get; set; } = null!;
|
||||
|
||||
public DbSet<Entities.RoleCheckListTemplateHeader> RoleCheckListTemplateHeaders { get; set; } = null!;
|
||||
public DbSet<Entities.RoleCheckPoint> RoleCheckPoints { get; set; } = null!;
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace WorkFlowCheck.DL
|
||||
modelBuilder.ApplyConfiguration(new NumberGeneratorDateTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new RoleTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new RoleCheckListTemplateHeaderTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new RoleCheckPointTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new UserTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new UserRoleTypeConfiguration());
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.DL.Configurations
|
||||
{
|
||||
public class RoleCheckPointTypeConfiguration : IEntityTypeConfiguration<Entities.RoleCheckPoint>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Entities.RoleCheckPoint> builder)
|
||||
{
|
||||
builder.ToTable("RoleCheckPoint");
|
||||
builder.HasKey(e => e.Id);
|
||||
builder.Property(e => e.Id).ValueGeneratedOnAdd();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.DL.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.DL.Entities
|
||||
@@ -12,6 +13,7 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public int Id { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; }
|
||||
public CheckStatus CheckStatus { get; set; }
|
||||
public DateTime DateExecution { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public virtual User User { get; set; }
|
||||
|
||||
@@ -9,6 +9,6 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public virtual Role Role { get; set; } = null!;
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; } = null!;
|
||||
public bool Enabled { get; set; } = false;
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkFlowCheck.DL.Entities
|
||||
{
|
||||
public class RoleCheckPoint
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int RoleId { get; set; }
|
||||
public virtual Role Role { get; set; } = null!;
|
||||
public int CheckPointId { get; set; }
|
||||
public virtual CheckPoint CheckPoint { get; set; } = null!;
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,847 @@
|
||||
// <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("20250331093742_Extend009")]
|
||||
partial class Extend009
|
||||
{
|
||||
/// <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<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, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914),
|
||||
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),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
|
||||
Token2FA = "",
|
||||
UserName = "admin"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281),
|
||||
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),
|
||||
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,98 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Extend009 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CheckStatus",
|
||||
table: "CheckListHeader",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RoleCheckPoint",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
RoleId = table.Column<int>(type: "int", nullable: false),
|
||||
CheckPointId = table.Column<int>(type: "int", nullable: false),
|
||||
Enabled = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RoleCheckPoint", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoleCheckPoint_CheckPoint_CheckPointId",
|
||||
column: x => x.CheckPointId,
|
||||
principalTable: "CheckPoint",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoleCheckPoint_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
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) });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoleCheckPoint_CheckPointId",
|
||||
table: "RoleCheckPoint",
|
||||
column: "CheckPointId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoleCheckPoint_RoleId",
|
||||
table: "RoleCheckPoint",
|
||||
column: "RoleId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "RoleCheckPoint");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckStatus",
|
||||
table: "CheckListHeader");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8912), new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8916) });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Users",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "CreatedAt", "LastModAt" },
|
||||
values: new object[] { new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9869), new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9870) });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,9 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
b.Property<int>("CheckListTemplateHeaderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CheckStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -515,6 +518,32 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
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")
|
||||
@@ -579,13 +608,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8912),
|
||||
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914),
|
||||
CreatedBy = "System",
|
||||
Email = "admin@nuvolar.hu",
|
||||
FirstName = "Administrator",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8916),
|
||||
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
|
||||
@@ -596,13 +625,13 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
CreatedAt = new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9869),
|
||||
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281),
|
||||
CreatedBy = "System",
|
||||
Email = "user@nuvolar.hu",
|
||||
FirstName = "User",
|
||||
IsDeleted = false,
|
||||
JwtToken = "",
|
||||
LastModAt = new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9870),
|
||||
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285),
|
||||
LastModBy = "System",
|
||||
LastName = "System",
|
||||
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
|
||||
@@ -744,6 +773,25 @@ namespace WorkFlowCheck.DL.Migrations
|
||||
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")
|
||||
|
||||
+3
-1
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
|
||||
[BindProperty]
|
||||
public CheckListHeaderDTO CheckListHeaderDTO { get; set; }
|
||||
|
||||
public List<SelectListItem> CheckStatus { get; set; }
|
||||
|
||||
public CheckListHeaderEditPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
|
||||
{
|
||||
@@ -22,6 +23,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
public async Task OnGet(int id)
|
||||
{
|
||||
CheckListHeaderDTO = await _checkListService.GetCheckListHeader(id);
|
||||
CheckStatus = _checkListService.GetCheckStatus();
|
||||
}
|
||||
public async Task<JsonResult> OnGetLoadCheckListRows(int id)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@page
|
||||
@model WorkFlowCheck.Web.Pages.CheckList.CheckListHeader.CheckListHeaderPageModel
|
||||
@{
|
||||
ViewData["Title"] = "Ellenőrzési sablonok";
|
||||
ViewData["Title"] = "Ellenőrzések";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Reflection;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
@@ -8,6 +12,9 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
{
|
||||
private readonly ILogger<IndexModel> _logger;
|
||||
private readonly ICheckListService _checkListService;
|
||||
|
||||
public List<SelectListItem> CheckStatus { get; set; }
|
||||
|
||||
public CheckListHeaderPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
|
||||
{
|
||||
_logger = logger;
|
||||
@@ -15,7 +22,10 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
||||
}
|
||||
public async Task OnGet()
|
||||
{
|
||||
CheckStatus = _checkListService.GetCheckStatus();
|
||||
}
|
||||
|
||||
|
||||
public async Task<JsonResult> OnGetLoadCheckListHeaders()
|
||||
{
|
||||
var results = await _checkListService.GetAllCheckListHeaderAsync();
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<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>
|
||||
@* <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" />
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
@page
|
||||
@model WorkFlowCheck.Web.Pages.UserAndRole.RoleCheckPointsPageModel
|
||||
@{
|
||||
ViewData["Title"] = "Szabályok - Ellenőrzési sablonok";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<div class="card shadow p-4">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button id="newRoleCheckPointsBtn" class="btn btn-primary float-right new-btn" data-bs-toggle="tooltip" data-bs-placement="top" title="Új felhasználó">
|
||||
<i class="bi bi-plus-square"></i>
|
||||
</button>
|
||||
</div>
|
||||
<table id="tbRoleCheckPointsPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Role name</th>
|
||||
<th>Checkpoint name</th>
|
||||
<th>Enabled</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Role name</th>
|
||||
<th>Checkpoint name</th>
|
||||
<th>Enabled</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
const table = new DataTable('#tbRoleCheckPointsPage', {
|
||||
ajax: {
|
||||
url: "@Url.Page("./RoleCheckPointsPage", "LoadRoleCheckPoints")",
|
||||
type: "GET",
|
||||
dataSrc : "data"
|
||||
},
|
||||
columns: [
|
||||
{ data: "id" },
|
||||
{ data: "roleDTO.roleName" },
|
||||
{ data: "CheckPointDTO.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: null, render: function (data, type, row) {
|
||||
return renderActionButtons(row.id);
|
||||
}}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
"targets": 0,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"targets": 4,
|
||||
"className": "text-center",
|
||||
"width": "10%"
|
||||
}
|
||||
],
|
||||
|
||||
processing:true,
|
||||
language: { url: '//cdn.datatables.net/plug-ins/2.2.2/i18n/hu.json',}
|
||||
});
|
||||
|
||||
$('#newRoleCheckPointsBtn').on('click', function ()
|
||||
{
|
||||
console.log('New button clicked!"');
|
||||
window.location.href = `@Url.Page("./RoleCheckPointEditPage")?id=0`;
|
||||
});
|
||||
|
||||
$('#tbRoleCheckPointsPage').on('click', '.edit-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
window.location.href = `@Url.Page("./RoleCheckPointEditPage")?id=${row.id}`;
|
||||
});
|
||||
|
||||
$('#tbRoleCheckPointsPage').on('click', '.delete-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
console.log(row);
|
||||
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>
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
{
|
||||
public class RoleCheckPointsPageModel : PageModel
|
||||
{
|
||||
private readonly ILogger<IndexModel> _logger;
|
||||
private readonly IUserService _userService;
|
||||
public RoleCheckPointsPageModel(ILogger<IndexModel> logger, IUserService userService)
|
||||
{
|
||||
_logger = logger;
|
||||
_userService = userService;
|
||||
}
|
||||
public async Task OnGet()
|
||||
{
|
||||
}
|
||||
public async Task<JsonResult> OnGetLoadRoleCheckPoints()
|
||||
{
|
||||
var results = await _userService.GetAllRoleCheckListTemplates();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Services
|
||||
@@ -200,6 +204,24 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public List<SelectListItem> GetCheckStatus()
|
||||
{
|
||||
return Enum.GetValues(typeof(CheckStatus))
|
||||
.Cast<CheckStatus>()
|
||||
.Select(e => new SelectListItem
|
||||
{
|
||||
Value = ((int)e).ToString(),
|
||||
Text = GetEnumDisplayName(e)
|
||||
}).ToList();
|
||||
}
|
||||
private string GetEnumDisplayName(Enum enumValue)
|
||||
{
|
||||
return enumValue.GetType()
|
||||
.GetMember(enumValue.ToString())
|
||||
.First()
|
||||
.GetCustomAttribute<DisplayAttribute>()?.Name ?? enumValue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
|
||||
namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
{
|
||||
@@ -18,5 +19,7 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<CheckListRowDTO> GetCheckListRow(int id);
|
||||
Task<ApiResponseDTO<CheckListRowDTO>> UpdateCheckListRow(CheckListRowDTO checkListRowDTO);
|
||||
|
||||
List<SelectListItem> GetCheckStatus();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,9 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeader(int id);
|
||||
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplates();
|
||||
Task<ApiResponseDTO<RoleCheckListTemplateHeaderDTO>> UpdateRoleCheckListTemplateHeader(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO);
|
||||
|
||||
Task<RoleCheckPointDTO> GetRoleCheckPoint(int id);
|
||||
Task<List<RoleCheckPointDTO>> GetAllRoleCheckPoints();
|
||||
Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint(RoleCheckPointDTO roleCheckPointDTO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,5 +335,76 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<RoleCheckPointDTO> GetRoleCheckPoint(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/GetRoleCheckPoint/{id}";
|
||||
var retVal = new RoleCheckPointDTO();
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<RoleCheckPointDTO>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<List<RoleCheckPointDTO>> GetAllRoleCheckPoints()
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/GetAllRoleCheckPoints";
|
||||
var retVal = new List<RoleCheckPointDTO>();
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<RoleCheckPointDTO>>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint(RoleCheckPointDTO roleCheckPointDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/UpdateRoleCheckPoint";
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, roleCheckPointDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<RoleCheckPointDTO>>(jsonString);
|
||||
|
||||
return response ?? new ApiResponseDTO<RoleCheckPointDTO>
|
||||
{
|
||||
IsSuccess = false,
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Hiba visszaadása
|
||||
return new ApiResponseDTO<RoleCheckPointDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user