예제 #1
0
 public IActionResult OnPost()
 {
     if (string.IsNullOrWhiteSpace(Model.ProblemType))
     {
         ModelState.AddModelError("Model.ProblemType", "* 关键字1不能为空");
     }
     if (string.IsNullOrWhiteSpace(Model.LanguageType))
     {
         ModelState.AddModelError("Model.LanguageType", "* 关键字2不能为空");
     }
     if (string.IsNullOrWhiteSpace(Model.RewardHelpMoneyCount))
     {
         ModelState.AddModelError("Model.RewardHelpMoneyCount", "* 悬赏帮帮币不能为空");
     }
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     _problemrepository.ProblemNew(Model);
     return(Redirect($"/ProblemModel/{Model.Id}"));
     //return RedirectToPage("/ProblemModel/Single");
 }