QuestionController.cs 842 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Threading.Tasks;
  2. using System.Web.Mvc;
  3. using System.Web.WebPages;
  4. using WeOnlineApp.Question;
  5. namespace WeOnlineApp.Controllers
  6. {
  7. public class QuestionController : IwbControllerBase
  8. {
  9. public QuestionController(QuestionAppService questionApp)
  10. {
  11. QuestionApp = questionApp;
  12. }
  13. public QuestionAppService QuestionApp { get; }
  14. public async Task<ActionResult> Detail(string id)
  15. {
  16. CheckAccount();
  17. if (id.IsEmpty())
  18. {
  19. CheckErrors("问题编号不能为空!");
  20. }
  21. var question = await QuestionApp.GeQuestionDetail(id);
  22. if (question == null)
  23. {
  24. CheckErrors("未查询到问题!");
  25. }
  26. return View(question);
  27. }
  28. }
  29. }