BUGFIX
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -426,12 +426,14 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
row.Answer = dtoRow.Answer;
|
row.Answer = dtoRow.Answer;
|
||||||
if (dtoRow.Photo != null && dtoRow.Photo.Length > 0)
|
if (dtoRow.Photo != null && dtoRow.Photo.Length > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
|
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
|
||||||
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
|
||||||
var fileName = $"PH_{timestamp}_{row.CheckListHeaderId}_{row.Id}.jpeg";
|
var fileName = $"PH_{timestamp}_{row.CheckListHeaderId}_{row.Id}.jpeg";
|
||||||
row.PhotoFileName = fileName;
|
row.PhotoFileName = fileName;
|
||||||
var filePath = Path.Combine(imageDirectory, fileName);
|
var filePath = Path.Combine(imageDirectory, fileName);
|
||||||
await File.WriteAllBytesAsync(filePath, dtoRow.Photo);
|
await File.WriteAllBytesAsync(filePath, dtoRow.Photo);
|
||||||
|
row.Answer = fileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,16 +482,7 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
retVal = true;
|
retVal = true;
|
||||||
break;
|
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;
|
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" &&
|
var totalRowCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
|
||||||
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true).Count();
|
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true).Count();
|
||||||
|
|
||||||
var answeredCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
|
var answeredCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
|
||||||
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true &&
|
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;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,13 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
user.FirstName = userDTO.FirstName;
|
user.FirstName = userDTO.FirstName;
|
||||||
user.LastName = userDTO.LastName;
|
user.LastName = userDTO.LastName;
|
||||||
user.Email = userDTO.Email;
|
user.Email = userDTO.Email;
|
||||||
|
user.NFCActive = userDTO.NFCActive;
|
||||||
|
user.NFCCode = userDTO.NFCCode;
|
||||||
user.JwtToken = "";
|
user.JwtToken = "";
|
||||||
|
user.Token2FA = "";
|
||||||
|
user.IsDeleted = false;
|
||||||
|
user.Active = userDTO.Active;
|
||||||
|
|
||||||
|
|
||||||
user.PasswordHash = PasswordHasher.HashPassword(userDTO.Password);
|
user.PasswordHash = PasswordHasher.HashPassword(userDTO.Password);
|
||||||
|
|
||||||
@@ -218,6 +224,8 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
user.FirstName = userDTO.FirstName;
|
user.FirstName = userDTO.FirstName;
|
||||||
user.LastName = userDTO.LastName;
|
user.LastName = userDTO.LastName;
|
||||||
user.Email = userDTO.Email;
|
user.Email = userDTO.Email;
|
||||||
|
user.Active = userDTO.Active;
|
||||||
|
user.NFCActive = userDTO.NFCActive;
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
|
|
||||||
retVal = _mapper.Map<UserDTO>(user);
|
retVal = _mapper.Map<UserDTO>(user);
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ namespace WorkFlowCheck.Common.DTO
|
|||||||
|
|
||||||
[DisplayName("NFC belépés")]
|
[DisplayName("NFC belépés")]
|
||||||
public bool NFCActive { get; set; }
|
public bool NFCActive { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("NFC kód")]
|
||||||
|
public string NFCCode { get; set; } = null!;
|
||||||
|
|
||||||
public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>();
|
public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||||
<input type="hidden" asp-for="UserDTO.Id" />
|
<input type="hidden" asp-for="UserDTO.Id" />
|
||||||
<input type="hidden" asp-for="UserDTO.Password" value="" />
|
<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.JwtToken" value="" />
|
||||||
<input type="hidden" asp-for="UserDTO.RoleDTO" value="" />
|
<input type="hidden" asp-for="UserDTO.RoleDTO" value="" />
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
@@ -27,10 +29,17 @@
|
|||||||
</div>
|
</div>
|
||||||
@if (Model.UserDTO.Id == 0)
|
@if (Model.UserDTO.Id == 0)
|
||||||
{
|
{
|
||||||
<div class="mb-3">
|
<div class="row">
|
||||||
<label asp-for="UserDTO.Password"></label>
|
<div class="mb-6">
|
||||||
<input asp-for="UserDTO.Password" class="form-control" type="password" />
|
<label asp-for="UserDTO.Password"></label>
|
||||||
<span asp-validation-for="UserDTO.Password" class="text-danger"></span>
|
<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>
|
||||||
}
|
}
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ if (!app.Environment.IsDevelopment())
|
|||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
//app.UseHttpsRedirection();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|||||||
Reference in New Issue
Block a user