Beispiel #1
0
        /// <summary>
        /// 获取并转换为<see cref="ExamsDetails"/>类型数据对象
        /// </summary>
        /// <returns></returns>
        public ExamsDetails ConvertToExamsDetails()
        {
            if (Exams == null)
            {
                return(null);
            }

            var details = new ExamsDetails
            {
                ExamId        = Exams.ExamId,
                ExamType      = Exams.ExamType,
                Title         = Exams.Title,
                Remarks       = Exams.Remarks,
                Time          = Exams.Time,
                Total         = Exams.Total,
                Pass          = Exams.Pass,
                Status        = Exams.Status,
                UserId        = Exams.UserId,
                UseCount      = Exams.UseCount,
                Answers       = Exams.Answers,
                Radio         = Exams.Radio,
                RedioTotal    = Exams.RedioTotal,
                Multiple      = Exams.Multiple,
                MultipleTotal = Exams.MultipleTotal,
                Judge         = Exams.Judge,
                JudgeTotal    = Exams.JudgeTotal,
                Filling       = Exams.Filling,
                FillingTotal  = Exams.FillingTotal,
                Ask           = Exams.Ask,
                AskTotal      = Exams.AskTotal,
                CreateTime    = Exams.CreateTime,
                StartTime     = Exams.StartTime,
                EndTime       = Exams.EndTime
            };

            details.CreatorName = UsersAccessor.GetUsernameFor(Exams.UserId);
            details.Questions   = SimpleQuestions;
            details.Courses     = DicCoursesTitle;

            return(details);
        }