From bd60138a899788c78fd28692325972d7a84d3081 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Thu, 20 Mar 2025 09:00:01 +0100 Subject: [PATCH] =?UTF-8?q?M=C3=B3dos=C3=ADt=C3=A1sok=20fejleszt=C3=A9shez?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/CheckListService.cs | 3 ++ .../CheckListTemplateHeaderEditPage.cshtml | 5 +++- .../CheckListTemplateRowEditPage.cshtml | 30 +++++++++++++++---- .../CheckListTemplateRowEditPage.cshtml.cs | 24 ++++++++++++++- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/WorkFlowCheck.BL/Services/CheckListService.cs b/src/WorkFlowCheck.BL/Services/CheckListService.cs index 4e860ad..6c71bc2 100644 --- a/src/WorkFlowCheck.BL/Services/CheckListService.cs +++ b/src/WorkFlowCheck.BL/Services/CheckListService.cs @@ -160,6 +160,9 @@ namespace WorkFlowCheck.BL.Services var res = await _dbContext.CheckListTemplateHeaders .Where(w => w.Id == Id) .Include(i => i.CheckListTemplateRows) + .ThenInclude(i=> i.CheckPoint) + .Include(i => i.CheckListTemplateRows) + .ThenInclude(i => i.Equipment) .AsNoTracking() .FirstOrDefaultAsync(); diff --git a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml index baa1cf5..855f6b1 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateHeader/CheckListTemplateHeaderEditPage.cshtml @@ -40,6 +40,7 @@ ID Short Name + Checkpoint OperationDescription AnswerType Action @@ -49,6 +50,7 @@ ID Short Name + Checkpoint OperationDescription AnswerType Action @@ -67,6 +69,7 @@ columns: [ { data: "id" }, { data: "rowIndex" }, + { data: "checkPointDTO.shortName" }, { data: "operationDescription" }, { data: "answerType" }, { data: null, render: function (data, type, row) { @@ -79,7 +82,7 @@ "visible": false }, { - "targets": 4, + "targets": 5, "className": "text-center", "width": "10%" } diff --git a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml index 8064717..81bd2cf 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml @@ -18,22 +18,42 @@ + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
-
- - - -
+ @section Scripts { diff --git a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml.cs b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml.cs index fd9507d..16ac183 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml.cs +++ b/src/WorkFlowCheck.Web/Pages/CheckListTemplate/CheckListTemplateRows/CheckListTemplateRowEditPage.cshtml.cs @@ -21,6 +21,12 @@ namespace WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateRows .Select(x => new SelectListItem { Value = x, Text = x }) .ToList(); + [BindProperty] + public List CheckPoints { get; set; } + + [BindProperty] + public List Equipments { get; set; } + public CheckListTemplateRowEditPageModel(ILogger logger, IBaseStockService baseStockService) { _baseStockService = baseStockService; @@ -29,7 +35,23 @@ namespace WorkFlowCheck.Web.Pages.CheckListTemplate.CheckListTemplateRows public async Task OnGet(int id) { - CheckListTemplateRow = await _baseStockService.GetCheckListTemplateRow(id); + await InitSelectItems(); + CheckListTemplateRow = await _baseStockService.GetCheckListTemplateRow(id); + } + private async Task InitSelectItems() + { + var checkPoints = await _baseStockService.GetAllCheckPoints(); + this.CheckPoints = new List(); + foreach (var checkPoint in checkPoints) + { + this.CheckPoints.Add(new SelectListItem() { Value = checkPoint.Id.ToString(), Text = checkPoint.ShortName }); + } + var equipments = await _baseStockService.GetAllEquipments(); + this.Equipments = new List(); + foreach (var equipment in equipments) + { + this.Equipments.Add(new SelectListItem() { Value = equipment.Id.ToString(), Text = equipment.ShortName }); + } } } }