Ellenőrzés lezárása
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -362,7 +363,38 @@ namespace WorkFlowCheck.BL.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO closeCheckListHeaderCloseDTO)
|
||||
{
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var checkListHeader = await _dbContext.CheckListHeaders
|
||||
.Where(w => w.Id == closeCheckListHeaderCloseDTO.Id &&
|
||||
(w.CheckStatus == CheckStatus.Blocked ||
|
||||
w.CheckStatus == CheckStatus.InProgress ||
|
||||
w.CheckStatus == CheckStatus.Open
|
||||
))
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (checkListHeader != null)
|
||||
{
|
||||
checkListHeader.CheckStatus = CheckStatus.Closed;
|
||||
checkListHeader.IsEditable = true;
|
||||
|
||||
Log.Warning($"Ellenőrzési lap lezárva: Ellenőrzés:{closeCheckListHeaderCloseDTO.Id}, " +
|
||||
$" Felhasználó:{closeCheckListHeaderCloseDTO.UserId}");
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<CheckListTemplateHeaderDTO> GetCheckListTemplateHeaderAsync(int Id)
|
||||
{
|
||||
var retVal = new CheckListTemplateHeaderDTO()
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
|
||||
Task<bool> AcceptCheckListHeaderAsync(int id, int userid);
|
||||
Task<bool> BlockCheckListHeaderAsync(int id, int userid);
|
||||
Task<bool> UnBlockCheckListHeaderAsync(int id, int userid);
|
||||
Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO closeCheckListHeaderCloseDTO);
|
||||
Task<byte[]> CreateCheckListHeaderPDFAsync(int checkListHeaderId);
|
||||
Task<CheckListHeaderDTO> StartNewCheckListAsync(CheckListHeaderNewDTO checkListHeaderNewDTO);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user