/// <summary> /// Command handler of listitemdoubleclick /// Moves to editpage /// </summary> private void OnListItemDoubleClickCommand() { if (SelectedEmpolyee != null) { _navigationService.NavigateTo(ViewModelLocator.EmployeeEditPage, SelectedEmpolyee.Value); } }
/// <summary> /// Gets the items that the employee has from the server /// </summary> private async void OnListItemsCommand() { try { IsLoading = true; var itemList = await _inventoryApiService.GetItemsByEmployeeId(Employee.Value.Id); _navigationService.NavigateTo(ViewModelLocator.InventoryItemSearchPage, itemList); } catch (Exception e) { _loggingService.LogInformation("Error during query of employee's items!", e); _dialogService.ShowWarning(e.Message); } finally { IsLoading = false; } }
private async void OnSaveCommand() { try { IsLoading = true; Item.EmployeeID = SelectedEmployee?.Id; await _inventoryApiService.AddNewInventoryItem(Item); _navigationService.NavigateTo(ViewModelLocator.InventoryItemSearchPage); } catch (Exception e) { _loggingService.LogError("Error during save of new item", e); _dialogService.ShowAlert(e.Message); } finally { IsLoading = false; } }