This commit is contained in:
2025-04-09 15:38:53 +02:00
parent e3ee93c74c
commit 02cef1bf23
7 changed files with 33 additions and 20 deletions
+7 -14
View File
@@ -426,12 +426,14 @@ namespace WorkFlowCheck.BL.Services
row.Answer = dtoRow.Answer;
if (dtoRow.Photo != null && dtoRow.Photo.Length > 0)
{
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
var fileName = $"PH_{timestamp}_{row.CheckListHeaderId}_{row.Id}.jpeg";
row.PhotoFileName = fileName;
var filePath = Path.Combine(imageDirectory, fileName);
await File.WriteAllBytesAsync(filePath, dtoRow.Photo);
row.Answer = fileName;
}
}
}
@@ -480,16 +482,7 @@ namespace WorkFlowCheck.BL.Services
retVal = true;
break;
}
if (row.CheckListTemplateRowDTO.AnswerType == "SI-N" && row.Answer == "Igen")
{
retVal = true;
break;
}
if (row.CheckListTemplateRowDTO.AnswerType == "I-SN" && row.Answer == "Nem")
{
retVal = true;
break;
}
}
}
}
@@ -501,18 +494,18 @@ namespace WorkFlowCheck.BL.Services
{
var retVal = false;
if (checkListHeaderDTO !=null && checkListHeaderDTO.CheckListRowDTO !=null && checkListHeaderDTO.CheckListRowDTO.Count > 0)
if (checkListHeaderDTO != null && checkListHeaderDTO.CheckListRowDTO != null && checkListHeaderDTO.CheckListRowDTO.Count > 0)
{
var totalRowCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true).Count();
var answeredCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true &&
string.IsNullOrEmpty(w.Answer) != false).Count();
string.IsNullOrEmpty(w.Answer) != true).Count();
if (totalRowCount != answeredCount) { retVal = true; }
if (totalRowCount == answeredCount) { retVal = true; }
}
return retVal;
}
@@ -198,7 +198,13 @@ namespace WorkFlowCheck.BL.Services
user.FirstName = userDTO.FirstName;
user.LastName = userDTO.LastName;
user.Email = userDTO.Email;
user.NFCActive = userDTO.NFCActive;
user.NFCCode = userDTO.NFCCode;
user.JwtToken = "";
user.Token2FA = "";
user.IsDeleted = false;
user.Active = userDTO.Active;
user.PasswordHash = PasswordHasher.HashPassword(userDTO.Password);
@@ -218,6 +224,8 @@ namespace WorkFlowCheck.BL.Services
user.FirstName = userDTO.FirstName;
user.LastName = userDTO.LastName;
user.Email = userDTO.Email;
user.Active = userDTO.Active;
user.NFCActive = userDTO.NFCActive;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<UserDTO>(user);