Mentés fölé csík

This commit is contained in:
2025-04-08 07:42:25 +02:00
parent c8b8f6ae92
commit 2dbcbd1ed8
16 changed files with 82 additions and 50 deletions
@@ -1,6 +1,8 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.CheckPoints.CheckPointEditPageModel
@using Microsoft.AspNetCore.Antiforgery
@using WorkFlowCheck.Common.Helper
@using WorkFlowCheck.Common.DTO
@inject IAntiforgery Antiforgery
@{
ViewData["Title"] = "Ellenőrzési pont";
@@ -37,6 +39,7 @@
<input type="checkbox" asp-for="CheckPointDTO.IsEnabled" class="form-check-input" />
<span asp-validation-for="CheckPointDTO.IsEnabled" class="text-danger"></span>
</div>
<hr class="mt-4 mb-3 border-secondary">
<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>
@@ -54,19 +57,17 @@
<thead class="table-primary">
<tr>
<th>ID</th>
<th>RowIndex</th>
<th>OperationDescription</th>
<th>AnswerType</th>
<th class="text-center">Action</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>RowIndex</th>
<th>OperationDescription</th>
<th>AnswerType</th>
<th class="text-center">Action</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
</tr>
</tfoot>
</table>
@@ -89,23 +90,16 @@
data: "answerType",
searchable: false,
sortable: false,
render: function ( data, type, row ) {
render: function ( data, type, row )
{
return renderAnswerType(data);
}
},
{ data: null, render: function (data, type, row) {
return renderActionButtons(row.id);
}}
}
],
columnDefs: [
{
"targets": 0,
"visible": false
},
{
"targets": 4,
"className": "text-center",
"width": "10%"
}
],
@@ -1,6 +1,9 @@
@page
@model WorkFlowCheck.Web.Pages.BaseStock.CheckPoints.CheckPointsPageModel
@using Microsoft.AspNetCore.Antiforgery
@using WorkFlowCheck.Common.Helper
@using WorkFlowCheck.Common.DTO
@inject IAntiforgery Antiforgery
@{
ViewData["Title"] = "Ellenőrzési pontok";
@@ -17,17 +20,20 @@
<thead class="table-primary">
<tr>
<th>ID</th>
<th>Enabled</th>
<th>Code</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.IsEnabled), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.Code), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.RoleName), typeof(CheckPointDTO))</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>Enabled</th>
<th>Short Name</th>
<th>Code</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.IsEnabled), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.Code), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.RoleName), typeof(CheckPointDTO))</th>
<th>Action</th>
</tr>
</tfoot>
@@ -56,6 +62,7 @@
},
{ data: "shortName" },
{ data: "code" },
{ data: "roleName" },
{ data: null, render: function (data, type, row) {
return renderActionButtons(row.id);
}}
@@ -66,7 +73,7 @@
"visible": false
},
{
"targets": 3,
"targets": 5,
"className": "text-center",
"width": "10%"
}
@@ -91,17 +98,7 @@
$('#tbCheckPointsPage').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');
}
});
deleteEntity(table, './CheckPointPage?handler=DeleteCheckPoint', row.id);
});
</script>
}
@@ -24,6 +24,11 @@ namespace WorkFlowCheck.Web.Pages.BaseStock.CheckPoints
var results = await _baseStockService.GetAllCheckPoints();
return new JsonResult(new { data = results });
}
public async Task<JsonResult> OnGetDeleteCheckPoint(int id)
{
var isSuccess = await _baseStockService.DeleteCheckPoint(id);
return new JsonResult(new { result = isSuccess });
}
}
}
@@ -25,6 +25,7 @@
<input asp-for="EquipmentDTO.EquipmentNumber" class="form-control" />
<span asp-validation-for="EquipmentDTO.EquipmentNumber" class="text-danger"></span>
</div>
<hr class="mt-4 mb-3 border-secondary">
<div class="mb-3 d-flex justify-content-between">
<button type="button" id="saveEquipment" class="btn btn-primary">Mentés</button>
<button type="button" class="btn btn-secondary" onclick="history.back()">Mégsem</button>
@@ -20,6 +20,7 @@
<input asp-for="LocationDTO.FullName" class="form-control" />
<span asp-validation-for="LocationDTO.FullName" class="text-danger"></span>
</div>
<hr class="mt-4 mb-3 border-secondary">
<div class="mb-3 d-flex justify-content-between">
<button type="button" id="saveLocation" class="btn btn-primary">Mentés</button>
<button type="button" class="btn btn-secondary" onclick="history.back()">Mégsem</button>