public async Task <IActionResult> OnGetAsync() { var user = await _userManager.GetUserAsync(User); if (user == null || !user.StudentIdentityConfirmed) { return(RedirectToPage("Index")); } var post = await _takeExpress.GetLastMissionInfoAsync(user.Id); TakeExpressInput = new TakeExpressInputModel { PostUserId = user.Id, }; if (post != null) { TakeExpressInput.ReceiveAddress1 = post.PosterAddress1; TakeExpressInput.ReceiveAddress2 = post.PosterAddress2; TakeExpressInput.ReceivePhoneNumber = post.PosterPhoneNumber; } ExpressCompanyList = await _expressCompanyListService.GetAllAsync(); PostUserId = user.Id; EditMark = false; return(Page()); }
private async Task LoadAsync(string postId) { CurrentUser = await _userManager.GetUserAsync(User); ExpressPost = await _takeExpressService.GetActiveMissionById(postId); if (CurrentUser == null || postId == null || ExpressPost == null) { return; } ExpressCompanyList = await _expressCompanyListService.GetAllAsync(); StudentIdentityConfirmed = CurrentUser.StudentIdentityConfirmed; CurrentUserId = CurrentUser.Id; PostId = ExpressPost.Id; }