Üzenetküldés frontenden

This commit is contained in:
2025-04-07 17:05:40 +02:00
parent a3be387ee1
commit b02fb58f2e
14 changed files with 338 additions and 70 deletions
@@ -14,7 +14,7 @@ public partial class CheckListPage : ContentPage
private readonly ICheckListService _checkListService;
private readonly IUserService _userService;
private bool _isLoading;
private UserDTO _currentUser;
public ICommand NewCommand { get; set; }
public ICommand ContinueCommand { get; set; }
@@ -42,6 +42,12 @@ public partial class CheckListPage : ContentPage
BlockCommand = new Command<CheckListHeaderDTO>(OnBlockItem);
}
private void SetInfo()
{
_currentUser = _userService.GetCurrentUser();
DeviceId.Text = _userService.DeviceId;
UserInfo.Text = $"{_currentUser?.FirstName} {_currentUser?.LastName}";
}
protected override bool OnBackButtonPressed()
{
Shell.Current.GoToAsync("//MainPage");
@@ -50,7 +56,7 @@ public partial class CheckListPage : ContentPage
protected override async void OnAppearing()
{
base.OnAppearing();
SetInfo();
BindingContext = this;
await LoadCheckListTemplate();
await LoadCheckList();
@@ -90,15 +96,15 @@ public partial class CheckListPage : ContentPage
private async Task LoadCheckListTemplate()
{
IsLoading = true;
var userId = _userService.GetCurrentUser()?.Id;
CheckListTemplate.ItemsSource = await _checkListService.GetCheckListTemplates(userId ?? 1);
CheckListTemplate.ItemsSource = await _checkListService.GetCheckListTemplates(_currentUser.Id);
IsLoading = false;
}
private async Task LoadCheckList()
{
IsLoading = true;
var userId = _userService.GetCurrentUser()?.Id;
CheckList.ItemsSource = await _checkListService.GetCheckLists(userId ?? 1);
CheckList.ItemsSource = await _checkListService.GetCheckLists(_currentUser.Id);
IsLoading = false;
}