1.1.019 verzió kiadása

This commit is contained in:
2025-04-25 10:31:42 +02:00
parent 1294a00219
commit a324f5f852
13 changed files with 86 additions and 29 deletions
@@ -7,7 +7,7 @@ namespace WorkFlowCheck.Web.Helpers
public static class SystemHelper
{
public static string DatabaseName = "";
public static string ProgramVersion = "v1.1.018";
public static string ProgramVersion = "v1.1.019";
public async static Task GetAPIInfoAsync(IConfiguration configuration)
{
@@ -1,5 +1,7 @@
@page
@model WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader.CheckListTemplateHeaderEditPageModel
@using WorkFlowCheck.Common.Helper
@using WorkFlowCheck.Common.DTO
@using Microsoft.AspNetCore.Antiforgery
@inject IAntiforgery Antiforgery
@{
@@ -57,20 +59,20 @@
<thead class="table-primary">
<tr>
<th>ID</th>
<th>Short Name</th>
<th>Checkpoint</th>
<th>OperationDescription</th>
<th>AnswerType</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="table-light">
<tr>
<th>ID</th>
<th>Short Name</th>
<th>Checkpoint</th>
<th>OperationDescription</th>
<th>AnswerType</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
@@ -134,17 +136,9 @@
$('#tbCheckListTemplateHeaderPage').on('click', '.delete-btn', function ()
{
const row = table.row($(this).closest('tr')).data();
showConfirmModal({
title: 'Törlés megerősítése',
message: 'Biztosan törölni szeretnéd ezt az elemet?',
okText: 'Törlés',
cancelText: 'Mégsem'
}).then(function(result) {
if(result === 'ok') {
console.log('Törlés végrehajtva');
}
});
deleteEntity(table, '/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage?handler=DeleteCheckListTemplateRow', row.id);
});
$("#saveCheckListTemplateHeader").click(function () {
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
var formData = getFormAsNestedObject('#CheckListTemplateHeaderForm');
@@ -71,5 +71,10 @@ namespace WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader
});
}
}
public async Task<JsonResult> OnGetDeleteCheckListTemplateRow(int id)
{
var isSuccess = await _checkListService.DeleteCheckListTemplateRow(id);
return new JsonResult(new { result = isSuccess });
}
}
}
@@ -265,6 +265,27 @@ namespace WorkFlowCheck.Web.Services
}
return retVal;
}
public async Task<bool> DeleteCheckListTemplateRow(int id)
{
string endpoint = $"{_httpClient.BaseAddress}api/CheckList/DeleteCheckListTemplateRow/{id}";
var retVal = false;
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO)
{
try
@@ -21,6 +21,7 @@ namespace WorkFlowCheck.Web.Services.Interfaces
Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id);
Task<bool> DeleteCheckListTemplateRow(int id);
Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO);
@@ -44,3 +44,7 @@ body {
.red-box {
background-color: red;
}
.icon-green {
color: green;
}
+3 -3
View File
@@ -29,7 +29,6 @@ function getFormAsNestedObject(formSelector) {
return result;
}
function showConfirmModal(options) {
return new Promise(function (resolve) {
// Alapértelmezett értékek
@@ -72,7 +71,6 @@ function showConfirmModal(options) {
modal.show();
});
}
function showConfirmModalWithMessage(options) {
return new Promise(function (resolve) {
// Alapértelmezett értékek
@@ -127,7 +125,6 @@ function showConfirmModalWithMessage(options) {
modal.show();
});
}
function showMessageModal(options) {
// Alapértelmezett értékek
var defaults = {
@@ -296,6 +293,9 @@ function renderAnswerType(data) {
if (data === 'P') {
return '<div class="text-center"><i class="fas fa-camera fa-2x"></i></div>';
}
if (data === 'PN') {
return '<div class="text-center"><i class="fas fa-camera fa-2x icon-green"></i></div>';
}
if (data === 'V') {
return '<div class="text-center"><span class="border border-dark rounded p-1">0,00</span></div>';
}