Exemplo n.º 1
0
        public ActionResult GetCoursesAuto(string term)
        {
            term = term ?? string.Empty;
            var list = CourseService.GetAllActiveCourseNames().Where(x => x.Value.ToLower().Contains(term.ToLower())).Take(10)
                       .Select(x => Select2VM.Item(x.Key, x.Value));

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult GetModulesAuto(int testId, string term)
        {
            term = term ?? string.Empty;
            var list = TestModuleService.GetAll(x => x.TestId == testId && x.Name.Contains(term))
                       .Select(x => Select2VM.Item(x.Id, x.Name));

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult GetEmployeeAuto(string term)
        {
            term = term ?? string.Empty;
            var list = EmployeeService.AllEmployees().Select(x => x.Value)
                       .Where(x => x.FullName.IndexOf(term, StringComparison.InvariantCultureIgnoreCase) >= 0 &&
                              (x.EmpGroup_TC == EmpGroups.Trainer || x.Employee_TC == Employees.Dinzis))
                       .Select(x => Select2VM.Item(x.Employee_TC, x.FullName));

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult GetAnswersAuto(int questionId, string term)
        {
            term = term ?? string.Empty;
            var list = TestAnswerService.GetAll(x =>
                                                x.QuestionId == questionId &&
                                                x.ComparableId == null &&
                                                x.Answer == null &&
                                                x.Description.Contains(term))
                       .Select(x => Select2VM.Item(x.Id, x.Description));

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        public ActionResult GetCoursesAuto(string term)
        {
            term = term ?? string.Empty;
            var list = GetOrgSig()
                       .Select(x => x.Group.Course).Distinct().Select(x => new { Id   = x.Course_TC,
                                                                                 Name = x.WebName })

                       .Where(x => x.Name.Contains(term)).Take(20)
                       .Select(x => Select2VM.Item(x.Id, x.Name)).ToList();

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult GetStudentsAuto(string term)
        {
            term = term ?? string.Empty;
            var list = GetOrgSig()
                       .Select(x => x.Student).Distinct().Select(x => new { Id   = x.Student_ID,
                                                                            Name = x.LastName + " " + x.FirstName + " " + x.MiddleName })

                       .Where(x => x.Name.Contains(term)).Take(20)
                       .Select(x => Select2VM.Item(x.Id, x.Name)).ToList();

            return(Json(new Select2VM(list), JsonRequestBehavior.AllowGet));
        }