Van új és folytatható CheckLista
This commit is contained in:
@@ -1,19 +1,56 @@
|
||||
using System.Windows.Input;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.MAUI.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
|
||||
public partial class CheckListPage : ContentPage
|
||||
{
|
||||
public CheckListPage()
|
||||
private readonly ICheckListService _checkListService;
|
||||
private readonly IUserService _userService;
|
||||
|
||||
public ICommand NewCommand { get; set; }
|
||||
public ICommand ContinueCommand { get; set; }
|
||||
|
||||
public CheckListPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
_checkListService = MauiProgram.ServiceProvider.GetRequiredService<ICheckListService>();
|
||||
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
|
||||
|
||||
}
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
Shell.Current.GoToAsync("//MainPage");
|
||||
return true;
|
||||
}
|
||||
public async void OnButtonNewCheck(object sender, EventArgs e)
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
NewCommand = new Command<CheckListTemplateHeaderDTO>(OnNewItem);
|
||||
ContinueCommand = new Command<CheckListHeaderDTO>(OnContinueItem);
|
||||
await LoadCheckListTemplate();
|
||||
await LoadCheckList();
|
||||
}
|
||||
private async void OnNewItem(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO)
|
||||
{
|
||||
|
||||
//await Navigation.PushAsync(new CheckPointEditPage(checkPointDTO));
|
||||
}
|
||||
private async void OnContinueItem(CheckListHeaderDTO checkListTemplateHeaderDTO)
|
||||
{
|
||||
|
||||
//await Navigation.PushAsync(new CheckPointEditPage(checkPointDTO));
|
||||
}
|
||||
private async Task LoadCheckListTemplate()
|
||||
{
|
||||
var userId = _userService.GetCurrentUser()?.Id;
|
||||
CheckListTemplate.ItemsSource = await _checkListService.GetCheckListTemplates(userId ?? 1);
|
||||
}
|
||||
private async Task LoadCheckList()
|
||||
{
|
||||
var userId = _userService.GetCurrentUser()?.Id;
|
||||
CheckList.ItemsSource = await _checkListService.GetCheckLists(userId ?? 1);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user