Feloldás mobilról
This commit is contained in:
@@ -96,7 +96,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckListHeaders
|
||||
.Include(i=> i.CheckListTemplateHeader)
|
||||
.Include(i => i.CheckListTemplateHeader)
|
||||
.Where(w => w.CheckStatus == CheckStatus.Open ||
|
||||
w.CheckStatus == CheckStatus.InProgress ||
|
||||
w.CheckStatus == CheckStatus.Blocked)
|
||||
@@ -176,5 +176,39 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<bool> UnBlockCheckListHeader(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var checkListHeader = await _dbContext.CheckListHeaders
|
||||
.Where(w => w.Id == checkListHeaderDTO.Id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (checkListHeader != null)
|
||||
{
|
||||
var userDTO = _userService.GetCurrentUser();
|
||||
var endpoint = $"{_httpClient.BaseAddress}api/CheckList/UnBlockCheckListHeader/{checkListHeaderDTO.Id}/{userDTO.Id}";
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
checkListHeader.CheckStatus = CheckStatus.InProgress;
|
||||
await _dbContext.SaveChangesAsync();
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<bool> BlockCheckListHeader(CheckListHeaderDTO checkListHeaderDTO) => throw new NotImplementedException();
|
||||
public async Task<bool> AcceptCheckListHeader(CheckListHeaderDTO checkListHeaderDTO) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user