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
+5 -12
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;
}
}
}
}
@@ -508,9 +501,9 @@ namespace WorkFlowCheck.BL.Services
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; }
}
@@ -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);
+3
View File
@@ -34,6 +34,9 @@ namespace WorkFlowCheck.Common.DTO
[DisplayName("NFC belépés")]
public bool NFCActive { get; set; }
[DisplayName("NFC kód")]
public string NFCCode { get; set; } = null!;
public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>();
}
}
@@ -18,6 +18,8 @@
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
<input type="hidden" asp-for="UserDTO.Id" />
<input type="hidden" asp-for="UserDTO.Password" value="" />
<input type="hidden" asp-for="UserDTO.NFCCode" value="" />
<input type="hidden" asp-for="UserDTO.JwtToken" value="" />
<input type="hidden" asp-for="UserDTO.RoleDTO" value="" />
<div class="mb-3">
@@ -27,11 +29,18 @@
</div>
@if (Model.UserDTO.Id == 0)
{
<div class="mb-3">
<div class="row">
<div class="mb-6">
<label asp-for="UserDTO.Password"></label>
<input asp-for="UserDTO.Password" class="form-control" type="password" />
<span asp-validation-for="UserDTO.Password" class="text-danger"></span>
</div>
<div class="mb-6">
<label asp-for="UserDTO.NFCCode"></label>
<input asp-for="UserDTO.NFCCode" class="form-control" type="password" />
<span asp-validation-for="UserDTO.NFCCode" class="text-danger"></span>
</div>
</div>
}
<div class="mb-3">
<label asp-for="UserDTO.Email"></label>
+1 -1
View File
@@ -82,7 +82,7 @@ if (!app.Environment.IsDevelopment())
app.UseHsts();
}
app.UseHttpsRedirection();
//app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();