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