1.1.033 Fényképek beküldése javítása

This commit is contained in:
2025-07-01 08:30:34 +02:00
parent 4f149f4eef
commit 8208b31d08
13 changed files with 34 additions and 13 deletions
@@ -2,6 +2,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System.Diagnostics;
using System.Net.Http.Json;
using System.Runtime.CompilerServices;
using WorkFlowCheck.Common.DTO;
@@ -156,24 +157,27 @@ namespace WorkFlowCheck.MAUI.Services
return retVal;
}
public async Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO)
public async Task<CheckListRowDTO> UpdateCheckListRow(CheckListRowDTO checkListRowDTO, bool withPhoto = true)
{
var retVal = checkListRowDTO;
try
{
var checkListRow = await _dbContext.CheckListRows.Where(w => w.Id == checkListRowDTO.Id).FirstOrDefaultAsync();
var checkListRow = await _dbContext.CheckListRows
//.AsNoTracking()
.Where(w => w.Id == checkListRowDTO.Id).FirstOrDefaultAsync();
if (checkListRow != null)
{
checkListRow.Answer = checkListRowDTO.Answer;
if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0)
if (checkListRowDTO.Photo != null && checkListRowDTO.Photo.Length > 0 && withPhoto)
{
checkListRow.Photo = checkListRowDTO.Photo;
}
await _dbContext.SaveChangesAsync();
}
}
catch (Exception)
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
return retVal;
}