Photo rendberakása + EF migráció

This commit is contained in:
2025-04-02 10:32:27 +02:00
parent fe7b52efde
commit 12bf69aadd
16 changed files with 1913 additions and 19 deletions
@@ -104,7 +104,13 @@
return renderAnswerType(data);
}
},
{ data: "answer" },
{ data: "answer",
searchable: false,
sortable: false,
render: function ( data, type, row ) {
return renderAnswerPhoto(data, row);
}
},
{ data: null, render: function (data, type, row) {
return renderActionButtons(row.id);
}}
@@ -28,7 +28,31 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
public async Task<JsonResult> OnGetLoadCheckListRows(int id)
{
CheckListHeaderDTO = await _checkListService.GetCheckListHeader(id);
return new JsonResult(new { data = CheckListHeaderDTO.CheckListRowDTO });
if (CheckListHeaderDTO.CheckListRowDTO?.Count() > 0)
{
foreach (var item in CheckListHeaderDTO.CheckListRowDTO)
{
if (item.CheckListTemplateRowDTO?.AnswerType == "P")
{
if (item.Photo != null && item.Photo.Length > 0)
{
item.Answer = ConvertToBase64(item.Photo);
}
}
}
}
return new JsonResult(new
{
data = CheckListHeaderDTO.CheckListRowDTO
});
}
public string ConvertToBase64(byte[] photo)
{
if (photo == null || photo.Length == 0)
return string.Empty;
return "data:image/jpeg;base64," + Convert.ToBase64String(photo);
}
}
}