public async Task <IActionResult> EmailDetailsModal(int id) { var credentials = await this.googleService.CheckForTokensAsync(); var accessToken = await this.googleService.GetAccessToken(credentials); var email = await this.context.Emails.FindAsync(id); if (email.StatusID == 1) { email = await this.apiService.FetchMessageBodyAsync(id, accessToken); } else { email = await this.apiService.GetMessageBodyAsync(id, accessToken); } if (email == null) { return(NotFound()); } var model = new EmailDetailsModalModel(); model.Email = this.emailMapper.MapFrom(email); model.Application = new ApplicationViewModel(); return(PartialView("_EmailDetailsModal", model)); }
public async Task <IActionResult> ApplicationDetailsModal(int id) { var application = await applicationServices.GetApplication(id); if (application == null) { return(NotFound()); } var model = new EmailDetailsModalModel(); model.Application = this.applicationMapper.MapFrom(application); return(PartialView("_EmailDetailsModal", model)); }