Пример #1
0
        public ActionResult GetGroupTests(int groupInfoId, AjaxGridRequest model)
        {
            var list = GroupTestService
                       .GetAll(x => x.GroupInfoId == groupInfoId)
                       .Select(x => new { x.Id, TestId = x.Test.Name }).ToPagedList(model.Page - 1, model.Rows);

            return(JsonGet(new GridData(list.PageCount,
                                        model.Page,
                                        list.ItemCount,
                                        list)));
        }
Пример #2
0
        public IQueryable <GroupTest> GetGroupTests(decimal studentId)
        {
            var groupIds = this.GetAll(x => x.Group.Course_TC == CourseTC.Test &&
                                       x.Student_ID == studentId).Select(x => x.Group_ID).ToList();

            if (!groupIds.Any())
            {
                return(Enumerable.Empty <GroupTest>().AsQueryable());
            }
            GroupTestService.LoadWith(x => x.Test);
            GroupTestService.LoadWith(x => x.TestPassRule);
            var today      = DateTime.Today;
            var groupTests = GroupTestService.GetAll(x => groupIds.Contains(x.GroupInfo.Group_ID) &&
                                                     x.DateBegin <= today && x.DateEnd >= today);

            return(groupTests);
        }