PositionSelect.razor.cs 967 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Microsoft.AspNetCore.Components;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using wispro.sp.entity;
  7. using wispro.sp.web.Services;
  8. namespace wispro.sp.web.Components
  9. {
  10. public partial class PositionSelect
  11. {
  12. private List<Position> _allPositions;
  13. private Position _SelectedItem;
  14. [Inject] OrganizationService _Service { get; set; }
  15. [Parameter]
  16. public int? PositionId { get; set; }
  17. [Parameter]
  18. public EventCallback<int?> PositionIdChanged { get; set; }
  19. protected override async System.Threading.Tasks.Task OnInitializedAsync()
  20. {
  21. base.OnInitialized();
  22. _allPositions = await _Service.getPositions();
  23. }
  24. private void OnSelectedItemChangedHandler(Position value)
  25. {
  26. _SelectedItem = value;
  27. PositionIdChanged.InvokeAsync(_SelectedItem.Id);
  28. }
  29. }
  30. }