diff --git a/src/WorkFlowCheck.BL/Services/CheckListService.cs b/src/WorkFlowCheck.BL/Services/CheckListService.cs index cd39164..856a823 100644 --- a/src/WorkFlowCheck.BL/Services/CheckListService.cs +++ b/src/WorkFlowCheck.BL/Services/CheckListService.cs @@ -131,7 +131,7 @@ namespace WorkFlowCheck.BL.Services return retVal; } var currentDate = DateTime.UtcNow; - var documentNumber = await _numberGeneratorService.GenerateNextNumberAsync(checkListTemplateHeader.NumberGenerator1.Id, currentDate); + var documentNumber = await _numberGeneratorService.GenerateNextNumberAsync(checkListTemplateHeader.NumberGenerator1Id ?? 1, currentDate); CheckListHeader checkListHeader = new CheckListHeader() { CheckListTemplateHeaderId = checkListHeaderNewDTO.CheckListTemplateHeaderId, diff --git a/src/WorkFlowCheck.BL/Services/Interfaces/INumberGeneratorService.cs b/src/WorkFlowCheck.BL/Services/Interfaces/INumberGeneratorService.cs index 4c6fdaf..14bd9f6 100644 --- a/src/WorkFlowCheck.BL/Services/Interfaces/INumberGeneratorService.cs +++ b/src/WorkFlowCheck.BL/Services/Interfaces/INumberGeneratorService.cs @@ -9,5 +9,6 @@ namespace WorkFlowCheck.BL.Services.Interfaces public interface INumberGeneratorService { Task GenerateNextNumberAsync(int templateId, DateTime? baseDate = null); + Task GetSampleAsync(int templateId, DateTime? baseDate = null); } } diff --git a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml index 59e0f80..be5e4fa 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml @@ -15,17 +15,24 @@ ID + IsEditable + DocumentNumber + DateExecution + ShortName Description - Short Name - Description + User Action ID - Short Name + IsEditable + DocumentNumber + DateExecution + ShortName Description + User Action @@ -42,8 +49,36 @@ }, columns: [ { data: "id" }, + { + data: "isEditable", + searchable: false, + sortable: false, + // visible: (aDurchgang==1 ? true : false), + className: "text-center", + render: function ( data, type, row ) { + if (data === true) { + return ''; + } + if (data === false) { + return ''; + } + return data; + } + + }, + { data: "documentNumber", + render: function (data, type, row) { + if (!data) return ''; + if (type === 'display' || type === 'filter') { + return dayjs(data).format('YYYY.MM.DD'); + } + return data; + } + }, + { data: "dateExecution" }, { data: "shortName" }, { data: "description" }, + { data: "user.userName" }, { data: null, render: function (data, type, row) { return renderActionButtons(row.id); }} diff --git a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml.cs b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml.cs index 32e6303..8039eee 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml.cs +++ b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml.cs @@ -1,12 +1,25 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using WorkFlowCheck.Web.Services.Interfaces; namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader { public class CheckListHeaderPageModel : PageModel { - public void OnGet() + private readonly ILogger _logger; + private readonly ICheckListService _checkListService; + public CheckListHeaderPageModel(ILogger logger, ICheckListService checkListService) { + _logger = logger; + _checkListService = checkListService; + } + public async Task OnGet() + { + } + public async Task OnGetLoadCheckListHeaders() + { + var results = await _checkListService.GetAllCheckListHeaderAsync(); + return new JsonResult(new { data = results }); } } } diff --git a/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml b/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml index c305adb..96ccfaa 100644 --- a/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml +++ b/src/WorkFlowCheck.Web/Pages/Shared/_Layout.cshtml @@ -147,6 +147,7 @@ + @await RenderSectionAsync("Scripts", required: false)