Welcome.razor.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Threading.Tasks;
  2. using wispro.sp.web.Models;
  3. using wispro.sp.web.Services;
  4. using Microsoft.AspNetCore.Components;
  5. using wispro.sp.web.Components;
  6. namespace wispro.sp.web.Pages
  7. {
  8. public partial class Welcome
  9. {
  10. private readonly EditableLink[] _links =
  11. {
  12. new EditableLink {Title = "Operation 1", Href = ""},
  13. new EditableLink {Title = "Operation 2", Href = ""},
  14. new EditableLink {Title = "Operation 3", Href = ""},
  15. new EditableLink {Title = "Operation 4", Href = ""},
  16. new EditableLink {Title = "Operation 5", Href = ""},
  17. new EditableLink {Title = "Operation 6", Href = ""}
  18. };
  19. private ActivitiesType[] _activities = { };
  20. private NoticeType[] _projectNotice = { };
  21. private CurrentUser _CurrentUser;
  22. [Inject] public IProjectService ProjectService { get; set; }
  23. [Inject] public IUserService _userService { get; set; }
  24. protected override async System.Threading.Tasks.Task OnInitializedAsync()
  25. {
  26. await base.OnInitializedAsync();
  27. _CurrentUser = _userService.CurrentUser;
  28. _projectNotice = await ProjectService.GetProjectNoticeAsync();
  29. _activities = await ProjectService.GetActivitiesAsync();
  30. foreach(ActivitiesType at in _activities)
  31. {
  32. System.Diagnostics.Debug.WriteLine(at.User.Name);
  33. }
  34. }
  35. }
  36. }