예제 #1
0
        public List<RosterSearchRecord> RosterSearchByLastName(RosterSearchRequest request)
        {
            using (var cn = new SqlConnection(Config.GetConnectionString()))
            {
                var p = new DynamicParameters();
                p.Add("@ClassId", request.ClassId);
                p.Add("@LastName", request.LastName);

                return
                    cn.Query<RosterSearchRecord>("RosterSearchByLastName", p, commandType: CommandType.StoredProcedure)
                        .ToList();
            }
        }
예제 #2
0
        public List<RosterSearchRecord> Search(RosterSearchRequest request)
        {
            if (string.IsNullOrEmpty(request.LastName))
            {
                return RosterSearchByGradeLevel(request);

            }

            if (request.GradeLevel == null)
            {
                return RosterSearchByLastName(request);
            }

            return RosterSearchByLastNameAndGradeLevel(request);
        }
예제 #3
0
        public ActionResult Search(RosterSearchRequest request)
        {
            var uberModel = new UberRoster();
               // var list = new List<RosterSearchRecord>();
            uberModel.SearchResults = _rosterRepository.Search(request);
            uberModel.CourseName = _teacherRepository.GetCourseById(request.ClassId).Name;
            uberModel.ClassId = request.ClassId;
            uberModel.EnrolledStudents = _rosterRepository.GetStudentsEnrolledIn(request.ClassId);
            uberModel.SearchRequest = request;

            return View("ClassRoster", uberModel);
        }