1.1.033 Fényképek beküldése javítása
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user