public ActionResult CertificationTrainers(string urlName) { var trainers = CertificationService.GetAll().ByUrlName(urlName).EmployeeCertifications.Select(ec => ec.Employee) .Where(e => e.SiteVisible).ToList(); return(View(ViewNames.Trainers, CommonVM.New(trainers, "Все преподаватели сертификации"))); }
public ActionResult ChooseSectionResponses() { var controlModel = SectionService.GetTreeWithSubsections(); return(View(CommonVM.New(controlModel, "Отзывы по направлениям"))); }
public ActionResult SectionTrainers(string urlName) { var section = SectionService.GetAll().ByUrlName(urlName); if (section == null) { return(null); } var courseTCs = CourseVMService .GetCourseTCListForTotalSection(section.Section_ID); var groups = GroupService.GetGroupsForCourses(courseTCs) .Where(g => g.Teacher_TC != null).ToList(); var groupCountByTrainers = groups.GroupBy(x => x.Teacher_TC) .ToDictionary(x => x.Key, x => x.Count()); var trainers = groups .Select(x => x.Teacher) .Distinct(x => x.Employee_TC) .Select(x => new { Teacher = x, Count = groupCountByTrainers.GetValueOrDefault(x.Employee_TC) }) .Where(x => x.Teacher.FinalSiteVisible && x.Count > 0) .OrderByDescending(x => x.Count).Select(x => x.Teacher) .ToList(); return(View(ViewNames.Trainers, CommonVM.New(trainers, "Преподаватели направления: " + section.Name))); }
public ActionResult BestAvatar() { var bestName = "BestGraduate"; var filename = UserImages.GetBestFileSys(bestName, UserSettingsService.SessionID); return(View(Views.Graduate.Avatar, CommonVM.New( Tuple.New(UserSettingsService.SessionID, System.IO.File.Exists(filename), bestName), "Создание аватара"))); }
public ActionResult Skype() { var employees = EmployeeService.GetAll().Where(e => Employees.Skype.Contains(e.Employee_TC)) .CommonList() .ToList(); return(View(CommonVM.New(employees, "Онлайн-консультация"))); }
public ActionResult RealAvatar() { var student = AuthService.GetCurrentStudent(); var cardColor = student.Card.ClabCardColor_TC; var bestName = "Card" + cardColor; var filename = UserImages.GetBestFileSys(bestName, UserSettingsService.SessionID); return(View(Views.Graduate.Avatar, CommonVM.New( Tuple.New(UserSettingsService.SessionID, System.IO.File.Exists(filename), bestName), "Создание аватара"))); }
public ActionResult WithoutWebinar() { var webinarCourseTCs = PriceService.CourseWithWebinar(); var ppCourseTCs = new HashSet <string>(PriceService.GetAllCurrent() .Where(x => x.PriceType_TC == PriceTypes.PrivatePersonWeekend).Select(x => x.Course_TC).Distinct()); var courses = CourseService.AllCoursesForList().Where(x => !x.IsTrackBool && ppCourseTCs.Contains(x.Course_TC) && !webinarCourseTCs.Contains(x.Course_TC)) .OrderBy(x => x.GetName()) .ToList(); var sectionCourses = GroupVMService.GetSectionCourses(courses); return(View(CommonVM.New(sectionCourses, "Курсы, не читаемые в режиме вебинар"))); }
public ActionResult CourseTrainers(string urlName) { var course = CourseService.GetByUrlName(urlName); if (course == null) { return(null); } var today = DateTime.Today; var employees = course.EmployeesCourses.Where(x => x.DateTo >= today && x.IsActive) .Select(x => x.Employee).Where(x => x.SiteVisible).ToList(); var title = "Все преподаватели курса " + "\"" + course.Name + "\""; return(View(ViewNames.Trainers, CommonVM.New(employees, title))); }
public ActionResult SectionResponses(string urlName) { var section = SectionService.GetAll().ByUrlName(urlName); if (section == null) { return(null); } var responses = SectionVMService .GetResponses(section.Section_ID) .Where(rr => rr.Type == RawQuestionnaireType.CourseComment) .OrderByDescending(r => r.UpdateDate) .Take(20).ToList(); var title = "Отзывы по направлению \"" + section.Name + "\""; return(View(ViewNames.Responses, CommonVM.New(responses, title))); }
public ActionResult Best2011(string id) { if (id.IsEmpty()) { return(NotFound()); } var model = Tuple.New(SimplePageService.GetAll().BySysName(SimplePages.BestStudent2011), id, UserImages.Best2011); var certificateFileSys = UserImages.GetGraduateCertificateFileSys(UserImages.Best2011, id); if (!System.IO.File.Exists(certificateFileSys)) { using (var image = Image.FromFile(UserImages.GetGraduateCertificateFileSys( UserImages.Best2011, "default"))) { ImageUtils.DrawFullNameStringBest(UserImages.Best2011, image, id).Save(certificateFileSys); } } return(View(ViewNames.BestStudent, CommonVM.New(model, model.V1.Title))); }
private ActionResult GetBestResult(string fullName, string imageName, string name, string postfix = null) { var simplePage = new SimplePage { Title = "Свидетельство " + StringUtils.AngleBrackets(name) }; var model = Tuple.New(simplePage, fullName, imageName); var certificateFileSys = UserImages.GetGraduateCertificateFileSys(imageName, fullName); if (!System.IO.File.Exists(certificateFileSys)) { using (var image = Image.FromFile(UserImages.GetGraduateCertificateFileSys( imageName, "default" + postfix))) { ImageUtils.DrawFullNameStringBest(imageName, image, fullName).Save(certificateFileSys); } } return(View(ViewNames.BestStudent, CommonVM.New(model, model.V1.Title))); }