BUGFIXEK UI oldalon
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.Enums;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
@@ -10,7 +11,8 @@ namespace WorkFlowCheck.MAUI.DataLayer.Entities
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int CheckListTemplateHeaderId { get; set; }
|
||||
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; }
|
||||
public virtual CheckListTemplateHeader? CheckListTemplateHeader { get; set; }
|
||||
public CheckStatus CheckStatus { get; set; }
|
||||
public DateTime DateExecution { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public string ShortName { get; set; } = null!;
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace WorkFlowCheck.MAUI.Mapper
|
||||
.ForMember(dest => dest.CheckListRows, opt => opt.MapFrom(src => src.CheckListRowDTO));
|
||||
CreateMap<CheckListRow, CheckListRowDTO>()
|
||||
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRow));
|
||||
CreateMap<CheckListRowDTO, CheckListRow>();
|
||||
CreateMap<CheckListRowDTO, CheckListRow>()
|
||||
.ForMember(dest => dest.CheckListTemplateRow, opt => opt.MapFrom(src => src.CheckListTemplateRowDTO));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,14 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
private async void OnNewItem(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO)
|
||||
{
|
||||
|
||||
//await Navigation.PushAsync(new CheckPointEditPage(checkPointDTO));
|
||||
IsLoading = true;
|
||||
await _checkListService.StartNew(
|
||||
new CheckListHeaderNewDTO()
|
||||
{
|
||||
UserId = _userService.GetCurrentUser().Id,
|
||||
CheckListTemplateHeaderId = checkListTemplateHeaderDTO.Id
|
||||
});
|
||||
IsLoading = false;
|
||||
}
|
||||
private async void OnContinueItem(CheckListHeaderDTO checkListHeaderDTO)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO)
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListHeaderNewDTO checkListHeaderNewDTO)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -64,13 +64,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
// Az API végpont meghatározása
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/checklist/StartNewCheckList";
|
||||
|
||||
// HTTP POST kérés küldése
|
||||
ApiRequestDTO<CheckListTemplateHeaderDTO> request = new ApiRequestDTO<CheckListTemplateHeaderDTO>();
|
||||
request.UserDTO = _userService.GetCurrentUser();
|
||||
request.Data = checkListTemplateHeaderDTO;
|
||||
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, request))
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, checkListHeaderNewDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace WorkFlowCheck.MAUI.Services.Interfaces
|
||||
{
|
||||
public interface ICheckListService
|
||||
{
|
||||
Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
||||
Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListHeaderNewDTO checkListHeaderNewDTO);
|
||||
Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(int checkPointId);
|
||||
Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(string checkPointCode);
|
||||
|
||||
|
||||
@@ -262,9 +262,11 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
await PrepareAuthenticatedRequestAsync();
|
||||
|
||||
var checkListHeader = await _dbContext.CheckListHeaders
|
||||
.Where(w => w.Id == Id)
|
||||
.Include(i => i.CheckListRows)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
var checkListHeaderDTO = _mapper.Map<CheckListHeaderDTO>(checkListHeader);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user