Snackbar meg ilyesmik
This commit is contained in:
@@ -11,10 +11,14 @@ namespace WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
public partial class CheckListWorkPage : ContentPage
|
||||
{
|
||||
private readonly ICheckListService _checkListService;
|
||||
private readonly ISyncService _syncService;
|
||||
|
||||
private string _checkPointCode;
|
||||
private int _checkListHeaderId;
|
||||
private UserDTO _userDTO;
|
||||
private bool _isLoading;
|
||||
|
||||
|
||||
public bool IsLoading
|
||||
{
|
||||
get => _isLoading;
|
||||
@@ -35,6 +39,7 @@ public partial class CheckListWorkPage : ContentPage
|
||||
_checkPointCode = checkPointCode;
|
||||
_checkListHeaderId = checkListHeaderId;
|
||||
_checkListService = MauiProgram.ServiceProvider.GetRequiredService<ICheckListService>();
|
||||
_syncService = MauiProgram.ServiceProvider.GetRequiredService<ISyncService>();
|
||||
_userDTO = MauiProgram.ServiceProvider.GetRequiredService<IUserService>().GetCurrentUser();
|
||||
|
||||
SaveCommand = new Command(OnSave);
|
||||
@@ -43,7 +48,17 @@ public partial class CheckListWorkPage : ContentPage
|
||||
|
||||
private async void OnSend()
|
||||
{
|
||||
|
||||
IsLoading = true;
|
||||
try
|
||||
{
|
||||
OnSave();
|
||||
await _syncService.SyncCheckListHeaderUp(_checkListHeaderId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Application.Current.MainPage.DisplayAlert("Hiba", ex.Message, "OK");
|
||||
}
|
||||
IsLoading = false;
|
||||
}
|
||||
private async void OnSave()
|
||||
{
|
||||
@@ -74,7 +89,6 @@ public partial class CheckListWorkPage : ContentPage
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
|
||||
Reference in New Issue
Block a user