Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck
This commit is contained in:
@@ -341,3 +341,4 @@ ASALocalRun/
|
|||||||
healthchecksdb
|
healthchecksdb
|
||||||
/src/WorkFlowCheck.API/Images
|
/src/WorkFlowCheck.API/Images
|
||||||
*.pdf
|
*.pdf
|
||||||
|
/src/WorkFlowCheck.API/Pdf/c86f3a6a-c646-4627-823c-7e24134b7725.docx
|
||||||
|
|||||||
@@ -303,6 +303,28 @@ namespace WorkFlowCheck.API.Controllers
|
|||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
[HttpGet("DeleteCheckListTemplateRow/{id}")]
|
||||||
|
public async Task<ApiResponseDTO<bool>> DeleteCheckListTemplateRow(int id)
|
||||||
|
{
|
||||||
|
var retVal = new ApiResponseDTO<bool>()
|
||||||
|
{
|
||||||
|
IsSuccess = true,
|
||||||
|
};
|
||||||
|
var result = await _checkListService.DeleteCheckListTemplateRowAsync(id);
|
||||||
|
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
retVal.IsSuccess = true;
|
||||||
|
retVal.Data = result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retVal.IsSuccess = false;
|
||||||
|
retVal.Errors.Add("No data!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
[HttpPost("UpdateCheckListTemplateRow")]
|
[HttpPost("UpdateCheckListTemplateRow")]
|
||||||
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow([FromBody] CheckListTemplateRowDTO CheckListTemplateRowDTO)
|
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow([FromBody] CheckListTemplateRowDTO CheckListTemplateRowDTO)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
@@ -22,19 +22,16 @@ using WorkFlowCheck.DL.Entities;
|
|||||||
|
|
||||||
namespace WorkFlowCheck.BL.Services
|
namespace WorkFlowCheck.BL.Services
|
||||||
{
|
{
|
||||||
public class CheckListService : ICheckListService
|
public class CheckListService : BaseService, ICheckListService
|
||||||
{
|
{
|
||||||
private readonly AppDbContext _dbContext;
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
private readonly INumberGeneratorService _numberGeneratorService;
|
private readonly INumberGeneratorService _numberGeneratorService;
|
||||||
|
|
||||||
public CheckListService(AppDbContext dbContext,
|
public CheckListService(AppDbContext dbContext,
|
||||||
IMapper mapper,
|
IMapper mapper,
|
||||||
INumberGeneratorService numberGeneratorService,
|
INumberGeneratorService numberGeneratorService,
|
||||||
IUserService userService)
|
IUserService userService) : base(dbContext, mapper)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
|
||||||
_mapper = mapper;
|
|
||||||
_numberGeneratorService = numberGeneratorService;
|
_numberGeneratorService = numberGeneratorService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,6 +394,7 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<CheckListTemplateHeaderDTO> GetCheckListTemplateHeaderAsync(int Id)
|
public async Task<CheckListTemplateHeaderDTO> GetCheckListTemplateHeaderAsync(int Id)
|
||||||
{
|
{
|
||||||
var retVal = new CheckListTemplateHeaderDTO()
|
var retVal = new CheckListTemplateHeaderDTO()
|
||||||
@@ -517,6 +515,10 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
public async Task<bool> DeleteCheckListTemplateRowAsync(int id)
|
||||||
|
{
|
||||||
|
return await DeleteEntityByIdAsync<CheckListTemplateRow>(id);
|
||||||
|
}
|
||||||
public async Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO)
|
public async Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO)
|
||||||
{
|
{
|
||||||
var retVal = new CheckListTemplateRowDTO() { };
|
var retVal = new CheckListTemplateRowDTO() { };
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
|||||||
Task<CheckListTemplateHeaderDTO> UpdateCheckListTemplateHeaderAsync(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
Task<CheckListTemplateHeaderDTO> UpdateCheckListTemplateHeaderAsync(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
||||||
|
|
||||||
Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id);
|
Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id);
|
||||||
|
Task<bool> DeleteCheckListTemplateRowAsync(int id);
|
||||||
Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
||||||
|
|
||||||
Task<CheckListRowDTO> GetCheckListRowAsync(int id);
|
Task<CheckListRowDTO> GetCheckListRowAsync(int id);
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WorkFlowCheck.Common.DTO
|
||||||
|
{
|
||||||
|
public class CheckListHeaderInfoDTO
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Összes ellenőrzési szám")]
|
||||||
|
public int TotalRowCount { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Még ellenőrizendő száma")]
|
||||||
|
public int EmptyAnswerCount { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Készültség %")]
|
||||||
|
public string ReadyPercent { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Ellenőrzési pontok száma")]
|
||||||
|
public int CheckPointCount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,20 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace WorkFlowCheck.Common.DTO
|
namespace WorkFlowCheck.Common.DTO
|
||||||
{
|
{
|
||||||
public class CheckListTemplateHeaderDTO
|
public class CheckListTemplateHeaderDTO
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
[DisplayName("Megnevezés")]
|
||||||
public string ShortName { get; set; } = null!;
|
public string ShortName { get; set; } = null!;
|
||||||
|
[DisplayName("Leírás")]
|
||||||
public string Description { get; set; } = null!;
|
public string Description { get; set; } = null!;
|
||||||
|
[DisplayName("Sorszám (munkalap)")]
|
||||||
public int? NumberGenerator1Id { get; set; }
|
public int? NumberGenerator1Id { get; set; }
|
||||||
|
[DisplayName("Sorszám (dokumentum)")]
|
||||||
public int? NumberGenerator2Id { get; set; }
|
public int? NumberGenerator2Id { get; set; }
|
||||||
|
|
||||||
public NumberGeneratorTemplateDTO? NumberGenerator1 { get; set; }
|
public NumberGeneratorTemplateDTO? NumberGenerator1 { get; set; }
|
||||||
public NumberGeneratorTemplateDTO? NumberGenerator2 { get; set; }
|
public NumberGeneratorTemplateDTO? NumberGenerator2 { get; set; }
|
||||||
public ICollection<CheckListTemplateRowDTO>? CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
|
public ICollection<CheckListTemplateRowDTO>? CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace WorkFlowCheck.Common.DTO
|
|||||||
/// V (Érték megadása)
|
/// V (Érték megadása)
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[DisplayName("Válasz tipus")]
|
||||||
public string AnswerType { get; set; } = null!;
|
public string AnswerType { get; set; } = null!;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace WorkFlowCheck.Web.Helpers
|
|||||||
public static class SystemHelper
|
public static class SystemHelper
|
||||||
{
|
{
|
||||||
public static string DatabaseName = "";
|
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)
|
public async static Task GetAPIInfoAsync(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
|||||||
+46
-11
@@ -34,16 +34,51 @@
|
|||||||
<form method="post" id="CheckListHeaderForm">
|
<form method="post" id="CheckListHeaderForm">
|
||||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||||
<input type="hidden" asp-for="CheckListHeaderDTO.Id" />
|
<input type="hidden" asp-for="CheckListHeaderDTO.Id" />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderDTO.DocumentNumber"></label>
|
||||||
|
<input asp-for="CheckListHeaderDTO.DocumentNumber" class="form-control" readonly/>
|
||||||
|
<span asp-validation-for="CheckListHeaderDTO.DocumentNumber" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderDTO.CheckStatus"></label>
|
||||||
|
<select asp-for="CheckListHeaderDTO.CheckStatus" class="form-control" asp-items="Model.CheckStatus" readonly></select>
|
||||||
|
<span asp-validation-for="CheckListHeaderDTO.CheckStatus" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderInfoDTO.TotalRowCount"></label>
|
||||||
|
<input asp-for="CheckListHeaderInfoDTO.TotalRowCount" class="form-control" readonly />
|
||||||
|
<span asp-validation-for="CheckListHeaderInfoDTO.TotalRowCount" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderInfoDTO.CheckPointCount"></label>
|
||||||
|
<input asp-for="CheckListHeaderInfoDTO.CheckPointCount" class="form-control" readonly />
|
||||||
|
<span asp-validation-for="CheckListHeaderInfoDTO.CheckPointCount" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderInfoDTO.EmptyAnswerCount"></label>
|
||||||
|
<input asp-for="CheckListHeaderInfoDTO.EmptyAnswerCount" class="form-control" readonly />
|
||||||
|
<span asp-validation-for="CheckListHeaderInfoDTO.EmptyAnswerCount" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label asp-for="CheckListHeaderInfoDTO.ReadyPercent"></label>
|
||||||
|
<input asp-for="CheckListHeaderInfoDTO.ReadyPercent" class="form-control" readonly />
|
||||||
|
<span asp-validation-for="CheckListHeaderInfoDTO.ReadyPercent" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label asp-for="CheckListHeaderDTO.ShortName"></label>
|
<label asp-for="CheckListHeaderDTO.ShortName"></label>
|
||||||
<input asp-for="CheckListHeaderDTO.ShortName" class="form-control" />
|
<input asp-for="CheckListHeaderDTO.ShortName" class="form-control" />
|
||||||
<span asp-validation-for="CheckListHeaderDTO.ShortName" class="text-danger"></span>
|
<span asp-validation-for="CheckListHeaderDTO.ShortName" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label asp-for="CheckListHeaderDTO.DocumentNumber"></label>
|
<label asp-for="CheckListHeaderDTO.Description"></label>
|
||||||
<input asp-for="CheckListHeaderDTO.DocumentNumber" class="form-control" />
|
<textarea asp-for="CheckListHeaderDTO.Description" class="form-control" rows="4"></textarea>
|
||||||
<span asp-validation-for="CheckListHeaderDTO.DocumentNumber" class="text-danger"></span>
|
<span asp-validation-for="CheckListHeaderDTO.Description" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="mt-4 mb-3 border-secondary">
|
<hr class="mt-4 mb-3 border-secondary">
|
||||||
<div class="mb-3 d-flex justify-content-between">
|
<div class="mb-3 d-flex justify-content-between">
|
||||||
<button type="button" id="saveCheckListHeader" class="btn btn-primary">Mentés</button>
|
<button type="button" id="saveCheckListHeader" class="btn btn-primary">Mentés</button>
|
||||||
@@ -63,20 +98,20 @@
|
|||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||||
<th>OperationDescription</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>AnswerType</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>Answer</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.Answer), typeof(CheckListRowDTO))</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tfoot class="table-light">
|
<tfoot class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Short Name</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>Checkpoint</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.CheckListTemplateRowDTO.CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||||
<th>OperationDescription</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>AnswerType</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>Answer</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListRowDTO.Answer), typeof(CheckListRowDTO))</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|||||||
+32
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
using System.Globalization;
|
||||||
using WorkFlowCheck.Common.DTO;
|
using WorkFlowCheck.Common.DTO;
|
||||||
using WorkFlowCheck.Web.Services.Interfaces;
|
using WorkFlowCheck.Web.Services.Interfaces;
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
|||||||
|
|
||||||
[BindProperty]
|
[BindProperty]
|
||||||
public CheckListHeaderDTO CheckListHeaderDTO { get; set; }
|
public CheckListHeaderDTO CheckListHeaderDTO { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
|
public CheckListHeaderInfoDTO CheckListHeaderInfoDTO { get; set; }
|
||||||
|
|
||||||
|
[BindProperty]
|
||||||
public List<SelectListItem> CheckStatus { get; set; }
|
public List<SelectListItem> CheckStatus { get; set; }
|
||||||
|
|
||||||
public CheckListHeaderEditPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
|
public CheckListHeaderEditPageModel(ILogger<IndexModel> logger, ICheckListService checkListService)
|
||||||
@@ -24,6 +30,32 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
|||||||
{
|
{
|
||||||
CheckListHeaderDTO = await _checkListService.GetCheckListHeader(id);
|
CheckListHeaderDTO = await _checkListService.GetCheckListHeader(id);
|
||||||
CheckStatus = _checkListService.GetCheckStatus();
|
CheckStatus = _checkListService.GetCheckStatus();
|
||||||
|
BuildCheckListHeaderInfo();
|
||||||
|
}
|
||||||
|
private void BuildCheckListHeaderInfo()
|
||||||
|
{
|
||||||
|
CheckListHeaderInfoDTO = new CheckListHeaderInfoDTO();
|
||||||
|
|
||||||
|
var result = CheckListHeaderDTO.CheckListRowDTO
|
||||||
|
.GroupBy(r => 1)
|
||||||
|
.Select(g => new
|
||||||
|
{
|
||||||
|
TotalRowCount = g.Count(),
|
||||||
|
EmptyAnswerCount = g.Count(r => string.IsNullOrEmpty(r.Answer)),
|
||||||
|
CheckPointCount = g.Select(r => r.CheckListTemplateRowDTO.CheckPointId).Distinct().Count()
|
||||||
|
})
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
CheckListHeaderInfoDTO.TotalRowCount = result.TotalRowCount;
|
||||||
|
CheckListHeaderInfoDTO.CheckPointCount = result.CheckPointCount;
|
||||||
|
CheckListHeaderInfoDTO.EmptyAnswerCount = result.EmptyAnswerCount;
|
||||||
|
if (CheckListHeaderInfoDTO.TotalRowCount > 0)
|
||||||
|
{
|
||||||
|
CheckListHeaderInfoDTO.ReadyPercent = ((CheckListHeaderInfoDTO.TotalRowCount - CheckListHeaderInfoDTO.EmptyAnswerCount) / CheckListHeaderInfoDTO.TotalRowCount * 100)
|
||||||
|
.ToString("0.00", new CultureInfo("hu-HU")) + " %"; ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public async Task<JsonResult> OnGetLoadCheckListRows(int id)
|
public async Task<JsonResult> OnGetLoadCheckListRows(int id)
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-18
@@ -1,5 +1,7 @@
|
|||||||
@page
|
@page
|
||||||
@model WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader.CheckListTemplateHeaderEditPageModel
|
@model WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateHeader.CheckListTemplateHeaderEditPageModel
|
||||||
|
@using WorkFlowCheck.Common.Helper
|
||||||
|
@using WorkFlowCheck.Common.DTO
|
||||||
@using Microsoft.AspNetCore.Antiforgery
|
@using Microsoft.AspNetCore.Antiforgery
|
||||||
@inject IAntiforgery Antiforgery
|
@inject IAntiforgery Antiforgery
|
||||||
@{
|
@{
|
||||||
@@ -57,20 +59,20 @@
|
|||||||
<thead class="table-primary">
|
<thead class="table-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Short Name</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>Checkpoint</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||||
<th>OperationDescription</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>AnswerType</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tfoot class="table-light">
|
<tfoot class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Short Name</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.RowIndex), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>Checkpoint</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckPointDTO.ShortName), typeof(CheckPointDTO))</th>
|
||||||
<th>OperationDescription</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.OperationDescription), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th>AnswerType</th>
|
<th>@DisplayNameHelper.GetDisplayName(nameof(CheckListTemplateRowDTO.AnswerType), typeof(CheckListTemplateRowDTO))</th>
|
||||||
<th class="text-center">Action</th>
|
<th class="text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
@@ -134,17 +136,9 @@
|
|||||||
$('#tbCheckListTemplateHeaderPage').on('click', '.delete-btn', function ()
|
$('#tbCheckListTemplateHeaderPage').on('click', '.delete-btn', function ()
|
||||||
{
|
{
|
||||||
const row = table.row($(this).closest('tr')).data();
|
const row = table.row($(this).closest('tr')).data();
|
||||||
showConfirmModal({
|
deleteEntity(table, '/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage?handler=DeleteCheckListTemplateRow', row.id);
|
||||||
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');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#saveCheckListTemplateHeader").click(function () {
|
$("#saveCheckListTemplateHeader").click(function () {
|
||||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||||
var formData = getFormAsNestedObject('#CheckListTemplateHeaderForm');
|
var formData = getFormAsNestedObject('#CheckListTemplateHeaderForm');
|
||||||
|
|||||||
+5
@@ -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;
|
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)
|
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
|||||||
|
|
||||||
|
|
||||||
Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id);
|
Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id);
|
||||||
|
Task<bool> DeleteCheckListTemplateRow(int id);
|
||||||
Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow(CheckListTemplateRowDTO checkListTemplateRowDTO);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,3 +44,7 @@ body {
|
|||||||
.red-box {
|
.red-box {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-green {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
@@ -29,7 +29,6 @@ function getFormAsNestedObject(formSelector) {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showConfirmModal(options) {
|
function showConfirmModal(options) {
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
// Alapértelmezett értékek
|
// Alapértelmezett értékek
|
||||||
@@ -72,7 +71,6 @@ function showConfirmModal(options) {
|
|||||||
modal.show();
|
modal.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showConfirmModalWithMessage(options) {
|
function showConfirmModalWithMessage(options) {
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
// Alapértelmezett értékek
|
// Alapértelmezett értékek
|
||||||
@@ -127,7 +125,6 @@ function showConfirmModalWithMessage(options) {
|
|||||||
modal.show();
|
modal.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMessageModal(options) {
|
function showMessageModal(options) {
|
||||||
// Alapértelmezett értékek
|
// Alapértelmezett értékek
|
||||||
var defaults = {
|
var defaults = {
|
||||||
@@ -296,6 +293,9 @@ function renderAnswerType(data) {
|
|||||||
if (data === 'P') {
|
if (data === 'P') {
|
||||||
return '<div class="text-center"><i class="fas fa-camera fa-2x"></i></div>';
|
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') {
|
if (data === 'V') {
|
||||||
return '<div class="text-center"><span class="border border-dark rounded p-1">0,00</span></div>';
|
return '<div class="text-center"><span class="border border-dark rounded p-1">0,00</span></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user