UI fejlesztése

This commit is contained in:
2025-03-24 16:47:28 +01:00
parent 29d94c9256
commit 8f38408646
13 changed files with 394 additions and 45 deletions
@@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System.Net.Http.Json;
using System.Runtime.CompilerServices;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.MAUI.DataLayer;
using WorkFlowCheck.MAUI.Services.Interfaces;
@@ -13,10 +14,10 @@ namespace WorkFlowCheck.MAUI.Services
{
private readonly IUserService _userService;
private readonly ISyncService _syncService;
public CheckListService(HttpClient httpClient,
IConfiguration configuration,
AppDbContext dbContext,
IMapper mapper,
public CheckListService(HttpClient httpClient,
IConfiguration configuration,
AppDbContext dbContext,
IMapper mapper,
IUserService userService,
ISyncService syncService) : base(httpClient, configuration, dbContext, mapper)
{
@@ -96,20 +97,46 @@ namespace WorkFlowCheck.MAUI.Services
public async Task<List<CheckListTemplateHeaderDTO>> GetCheckListTemplates(int userId)
{
await _syncService.SyncDatas();
await _syncService.SyncDatas();
var retVal = new List<CheckListTemplateHeaderDTO>();
try
{
var res = await _dbContext.CheckListTemplateHeaders.ToListAsync();
var res = await _dbContext.CheckListTemplateHeaders.ToListAsync();
retVal = _mapper.Map<List<CheckListTemplateHeaderDTO>>(res);
}
catch (Exception ex)
{
}
return retVal;
}
public async Task<List<CheckListRowDTO>> GetCheckListRowsByCheckPointCode(int userId, int checkListHeaderId, string checkPointCode)
{
var retVal = new List<CheckListRowDTO>();
try
{
var checkListRows = await _dbContext.CheckListRows
.Include(i => i.CheckListTemplateRow)
.ThenInclude(i => i.CheckPoint)
.Include(i => i.CheckListHeader)
.Where(w => w.CheckListTemplateRow.CheckPoint.Code == checkPointCode &&
w.CheckListHeader.UserId == userId &&
w.CheckListHeaderId == checkListHeaderId)
.AsNoTracking()
.ToListAsync();
retVal = _mapper.Map<List<CheckListRowDTO>>(checkListRows);
}
catch (Exception ex)
{
}
return retVal;
}
}
}