WORD -> PDF
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
<!-- Tab navigáció -->
|
||||
<div class="card shadow p-0">
|
||||
<div class="card-header p-0">
|
||||
<div class="card-header p-0" style="border:none;">
|
||||
<ul class="nav nav-tabs" id="checklistTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="general-tab" data-bs-toggle="tab" data-bs-target="#general" type="button" role="tab">Adatok</button>
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
<li><a class="dropdown-item" asp-area="" asp-page="/UserAndRole/RolePage">Szabályok</a></li>
|
||||
<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>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
|
||||
@@ -1,4 +1,100 @@
|
||||
@page
|
||||
@model WorkFlowCheck.Web.Pages.UserAndRole.RoleCheckListTemplateHeadersPageModel
|
||||
@model WorkFlowCheck.Web.Pages.RoleCheckListTemplateHeadersAndRole.RoleCheckListTemplateHeadersPageModel
|
||||
@{
|
||||
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="newRoleCheckListTemplateHeadersBtn" 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="tbRoleCheckListTemplateHeaderssPage" class="table table-bordered table-hover table-sm" style="width:100%">
|
||||
<thead class="table-primary">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>RoleCheckListTemplateHeaders Name</th>
|
||||
<th>E-mail</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>RoleCheckListTemplateHeaders Name</th>
|
||||
<th>E-mail</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
const table = new DataTable('#tbRoleCheckListTemplateHeaderssPage', {
|
||||
ajax: {
|
||||
url: "@Url.Page("./RoleCheckListTemplateHeadersPage", "LoadRoleCheckListTemplateHeaderss")",
|
||||
type: "GET",
|
||||
dataSrc : "data"
|
||||
},
|
||||
columns: [
|
||||
{ data: "id" },
|
||||
{ data: "firstName" },
|
||||
{ data: "lastName" },
|
||||
{ data: "RoleCheckListTemplateHeadersName" },
|
||||
{ data: "email" },
|
||||
{ data: null, render: function (data, type, row) {
|
||||
return renderActionButtons(row.id);
|
||||
}}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
"targets": 0,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"targets": 5,
|
||||
"className": "text-center",
|
||||
"width": "10%"
|
||||
}
|
||||
],
|
||||
|
||||
processing:true,
|
||||
language: { url: '//cdn.datatables.net/plug-ins/2.2.2/i18n/hu.json',}
|
||||
});
|
||||
|
||||
$('#newRoleCheckListTemplateHeadersBtn').on('click', function ()
|
||||
{
|
||||
console.log('New button clicked!"');
|
||||
window.location.href = `@Url.Page("./RoleCheckListTemplateHeadersEditPage")?id=0`;
|
||||
});
|
||||
|
||||
$('#tbRoleCheckListTemplateHeaderssPage').on('click', '.edit-btn', function ()
|
||||
{
|
||||
const row = table.row($(this).closest('tr')).data();
|
||||
window.location.href = `@Url.Page("./RoleCheckListTemplateHeadersEditPage")?id=${row.id}`;
|
||||
});
|
||||
|
||||
$('#tbRoleCheckListTemplateHeaderssPage').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>
|
||||
}
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Pages.UserAndRole
|
||||
{
|
||||
public class RoleCheckListTemplateHeadersPageModel : PageModel
|
||||
public class RoleCheckListTemplatesPageModel : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
private readonly ILogger<IndexModel> _logger;
|
||||
private readonly IUserService _userService;
|
||||
public RoleCheckListTemplatesPageModel(ILogger<IndexModel> logger, IUserService userService)
|
||||
{
|
||||
_logger = logger;
|
||||
_userService = userService;
|
||||
}
|
||||
public async Task OnGet()
|
||||
{
|
||||
}
|
||||
public async Task<JsonResult> OnGetLoadRoleCheckListTemplates()
|
||||
{
|
||||
var results = await _userService.getall();
|
||||
return new JsonResult(new { data = results });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<List<UserRoleDTO>> GetAllUserRoles();
|
||||
Task<ApiResponseDTO<UserRoleDTO>> UpdateUserRole(UserRoleDTO userRoleDTO);
|
||||
|
||||
|
||||
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplates();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,5 +265,26 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplates()
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/GetAllRoleCheckListTemplateHeaders";
|
||||
var retVal = new List<RoleCheckListTemplateHeaderDTO>();
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<RoleCheckListTemplateHeaderDTO>>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user