Welcome.razor.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. using System.Collections.Generic;
  7. using wispro.sp.entity;
  8. namespace wispro.sp.web.Pages
  9. {
  10. public partial class Welcome
  11. {
  12. private readonly EditableLink[] _links =
  13. {
  14. new EditableLink {Title = "Operation 1", Href = ""},
  15. new EditableLink {Title = "Operation 2", Href = ""},
  16. new EditableLink {Title = "Operation 3", Href = ""},
  17. new EditableLink {Title = "Operation 4", Href = ""},
  18. new EditableLink {Title = "Operation 5", Href = ""},
  19. new EditableLink {Title = "Operation 6", Href = ""}
  20. };
  21. private ActivitiesType[] _activities = { };
  22. private NoticeType[] _projectNotice = { };
  23. private CurrentUser _CurrentUser;
  24. private List<AppealRecord> AppealRecords = new List<AppealRecord>();
  25. [Inject] public IProjectService ProjectService { get; set; }
  26. [Inject] public IUserService _userService { get; set; }
  27. [Inject] protected AppealTypeService _atService { get; set; }
  28. protected override async System.Threading.Tasks.Task OnInitializedAsync()
  29. {
  30. await base.OnInitializedAsync();
  31. _CurrentUser = _userService.CurrentUser;
  32. _projectNotice = await ProjectService.GetProjectNoticeAsync();
  33. //_activities = await ProjectService.GetActivitiesAsync();
  34. AppealRecords = await _atService.GetUserAppeals(_CurrentUser.Userid);
  35. AppealRecords.Sort((a, b) =>
  36. {
  37. var sd = (a.ReviewTime == null) ? a.ReviewTime : a.CreateTime;
  38. var ed = (b.ReviewTime == null) ? b.ReviewTime : b.CreateTime;
  39. if (ed > sd)
  40. {
  41. return 1;
  42. }
  43. else
  44. {
  45. return -1;
  46. }
  47. });
  48. foreach (AppealRecord at in AppealRecords)
  49. {
  50. System.Diagnostics.Debug.WriteLine(at.Item.CaseNo);
  51. }
  52. }
  53. }
  54. }