BUGFIX-ek

This commit is contained in:
2025-03-31 22:13:17 +02:00
parent 61dd5bc9a1
commit 5207f32712
7 changed files with 38 additions and 20 deletions
+6 -1
View File
@@ -5,6 +5,7 @@ using Serilog;
using System.Collections.Generic; using System.Collections.Generic;
using WorkFlowCheck.BL.Services.Interfaces; using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO; using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Common.Enums;
using WorkFlowCheck.DL; using WorkFlowCheck.DL;
using WorkFlowCheck.DL.Entities; using WorkFlowCheck.DL.Entities;
@@ -322,7 +323,11 @@ namespace WorkFlowCheck.BL.Services
try try
{ {
var res = await _dbContext.CheckListHeaders var res = await _dbContext.CheckListHeaders
.Where(w => w.IsEditable && w.UserId == userId && w.IsDeleted != true) .Where(w => w.IsEditable &&
w.UserId == userId &&
w.IsDeleted != true &&
(w.CheckStatus == CheckStatus.InProgress ||
w.CheckStatus == CheckStatus.Open))
.Include(i => i.CheckListRows) .Include(i => i.CheckListRows)
//.ThenInclude(i => i.CheckListTemplateRow) //.ThenInclude(i => i.CheckListTemplateRow)
.AsNoTracking() .AsNoTracking()
@@ -96,7 +96,14 @@
{ data: "checkListTemplateRowDTO.rowIndex" }, { data: "checkListTemplateRowDTO.rowIndex" },
{ data: "checkListTemplateRowDTO.checkPointDTO.shortName" }, { data: "checkListTemplateRowDTO.checkPointDTO.shortName" },
{ data: "checkListTemplateRowDTO.operationDescription" }, { data: "checkListTemplateRowDTO.operationDescription" },
{ data: "checkListTemplateRowDTO.answerType" }, {
data: "checkListTemplateRowDTO.answerType",
searchable: false,
sortable: false,
render: function ( data, type, row ) {
return renderAnswerType(data);
}
},
{ data: "answer" }, { data: "answer" },
{ data: null, render: function (data, type, row) { { data: null, render: function (data, type, row) {
return renderActionButtons(row.id); return renderActionButtons(row.id);
@@ -151,8 +151,6 @@
formData.CheckListTemplateHeaderDTO.CheckListTemplateRowDTO=[]; formData.CheckListTemplateHeaderDTO.CheckListTemplateRowDTO=[];
console.log(formData.CheckListTemplateHeaderDTO);
if ($form.valid()) if ($form.valid())
{ {
$.ajax({ $.ajax({
@@ -64,7 +64,7 @@
}, },
data: JSON.stringify(formData.RoleCheckListTemplateHeaderDTO), data: JSON.stringify(formData.RoleCheckListTemplateHeaderDTO),
success: function (response) { success: function (response) {
// console.log(response);
if (response.success) if (response.success)
{ {
showMessageModal({ showMessageModal({
@@ -15,8 +15,8 @@
<form method="post" id="RoleCheckPointForm"> <form method="post" id="RoleCheckPointForm">
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" /> <meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
<input type="hidden" asp-for="RoleCheckPointDTO.Id" /> <input type="hidden" asp-for="RoleCheckPointDTO.Id" />
<div class="mb-3"> <div class="mb-3">
<div class="col-md-3"> <div class="col-md-3">
<label asp-for="RoleCheckPointDTO.RoleId"></label> <label asp-for="RoleCheckPointDTO.RoleId"></label>
@@ -49,10 +49,7 @@
var formData = getFormAsNestedObject('#RoleCheckPointForm'); var formData = getFormAsNestedObject('#RoleCheckPointForm');
const $form = $('#RoleCheckPointForm'); const $form = $('#RoleCheckPointForm');
formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointForm input[name="RoleCheckPointDTO.Enabled"]').is(':checked'); formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointForm input[name="RoleCheckPointDTO.Enabled"]').is(':checked');
// formData.RoleCheckPointDTO.Enabled = $('#RoleCheckPointDTO_Enabled').is(':checked');
// console.log(formData);
console.log(formData.RoleCheckPointDTO);
if ($form.valid()) if ($form.valid())
{ {
$.ajax({ $.ajax({
@@ -64,7 +61,7 @@
}, },
data: JSON.stringify(formData.RoleCheckPointDTO), data: JSON.stringify(formData.RoleCheckPointDTO),
success: function (response) { success: function (response) {
if (response.success) if (response.success)
{ {
showMessageModal({ showMessageModal({
@@ -35,7 +35,7 @@
var formData = getFormAsNestedObject('#RoleForm'); var formData = getFormAsNestedObject('#RoleForm');
const $form = $('#RoleForm'); const $form = $('#RoleForm');
formData.RoleDTO.RoleDTO=[];
if ($form.valid()) if ($form.valid())
{ {
@@ -46,13 +46,24 @@
'X-CSRF-TOKEN': csrfToken, 'X-CSRF-TOKEN': csrfToken,
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
data: JSON.stringify(formData.Role), data: JSON.stringify(formData.RoleDTO),
success: function (response) { success: function (response) {
showMessageModal({ if (response.success)
title: 'Figyelmem!', {
message: 'Sikeres mentés.', showMessageModal({
okText: 'Értettem' title: 'Figyelmem!',
}); message: 'Sikeres mentés.',
okText: 'Értettem'
});
}
else
{
showMessageModal({
title: 'Figyelmem, HIBA!',
message: 'Sikertelen mentés.',
okText: 'Értettem'
});
}
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
// Hiba esetén // Hiba esetén
@@ -53,7 +53,7 @@
}, },
data: JSON.stringify(formData.UserRoleDTO), data: JSON.stringify(formData.UserRoleDTO),
success: function (response) { success: function (response) {
// console.log(response);
if (response.success) if (response.success)
{ {
showMessageModal({ showMessageModal({