public VcrPlayViewModel GetVcrPlayViewModelByLesson(string lessonid) { var lsnMdl = lessonBLL.Single(lessonid); var vcrMdls = GetVcrs(lessonid); var testMdls = new List <VcrTest>(); var fileMdls = new List <VcrFile>(); if (vcrMdls != null && vcrMdls.Count() > 0) { testMdls = GetVcrTests(vcrMdls.FirstOrDefault().Id).ToList(); fileMdls = GetVcrFiles(vcrMdls.FirstOrDefault().Id).ToList(); } var playcontent = new VcrPlayContent() { vcrFiles = fileMdls, vcrTests = testMdls }; return(new VcrPlayViewModel { LessonInfo = lsnMdl, vcrs = vcrMdls, VcrPlayContent = playcontent, SelectedVcr = new Entity.TrainLesson.Vcr() }); }
public LessonVcrViewModel GetLessonVcrViewModel(string k, out int ttl, int pg = 1) { var mdl = _lessonBLL.Single(k); var vcrs = GetVcrs(k, out ttl, pg); return(new LessonVcrViewModel { baseLesson = mdl, vcrs = vcrs }); }