public ActionResult LoadExe(long exeId) { ExercisesDTO dto = exercisesService.GetById(exeId); if (dto == null) { return(Json(new AjaxResult { Status = "error", ErrorMsg = "考题不存在" })); } return(Json(new AjaxResult { Status = "success", Data = dto })); }
public ExercisesDTO ToDTO(ExercisesEntity entity) { ExercisesDTO dto = new ExercisesDTO(); dto.CreateDateTime = entity.CreateDateTime; dto.Id = entity.Id; dto.OptionA = entity.OptionA; dto.OptionB = entity.OptionB; dto.OptionC = entity.OptionC; dto.OptionD = entity.OptionD; dto.RightKeyId = entity.RightKeyId; dto.RightKeyName = entity.RightKey.Name; dto.TestPaperId = entity.TestPaperId; dto.TestPaperTitle = entity.TestPaper.TestTitle; dto.Title = entity.Title; dto.Tip = entity.Tip; return(dto); }