public async Task <IActionResult> Detail(HelperTipsTypes type,
                                                 [FromQuery] Guid id,
                                                 [FromQuery] bool testable = false)
        {
            var modalTitle    = "";
            var modalContent  = "";
            var examStartPath = "";

            if (type == HelperTipsTypes.Exam)
            {
                var exam = (await _ExamCategoryServices.GetAsync(id)).Data;
                modalTitle   = String.Format(L["{0} tips"], exam.Name);
                modalContent = exam.Tips;
            }
            else if (type == HelperTipsTypes.SkillCategory)
            {
                var sCat = (await _SkillCategoryServices.GetAsync(id)).Data;
                var exam = (await _ExamCategoryServices.GetAsync(sCat.ExamCategoryId)).Data;
                modalTitle   = String.Format(L["{0}:{1} tips"], exam.Name, sCat.Name);
                modalContent = sCat.Tips;
            }
            else if (type == HelperTipsTypes.SkillPart)
            {
                var sPart = (await _SkillPartServices.GetAsync(id)).Data;
                var sCat  = (await _SkillCategoryServices.GetAsync(sPart.ExamSkillCategoryId)).Data;
                var exam  = (await _ExamCategoryServices.GetAsync(sCat.ExamCategoryId)).Data;

                modalTitle   = String.Format(L["{0}:{1} {2} tips"], exam.Name, sCat.Name, sPart.Name);
                modalContent = sPart.Tips;
            }
            ViewBag.ModalTitle    = modalTitle;
            ViewBag.ModalContent  = modalContent;
            ViewBag.ExamStartPath = examStartPath;
            return(PartialView("~/Pages/_Common/Partials/Tips.cshtml"));
        }
Esempio n. 2
0
        public async Task <IActionResult> RedirectToDataManager(Guid skillPartId)
        {
            var skillPart = await _SkillPartServices.GetAsync(skillPartId);

            if (!skillPart.Success && skillPart.Data == null)
            {
                return(Redirect("/exams/exam-categories"));
            }
            var skillCat = await _SkillCategoryServices.GetAsync(skillPart.Data.ExamSkillCategoryId);

            if (!skillCat.Success && skillCat.Data == null)
            {
                return(Redirect("/exams/exam-categories"));
            }

            return(Redirect($"/manager/exam-categories/{skillCat.Data.ExamCategoryId}/skill-categories/{skillCat.Data.Id}/skill-parts/{skillPart.Data.Id}/exam-data-libraries"));
        }