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(); } }
public List<RosterSearchRecord> Search(RosterSearchRequest request) { if (string.IsNullOrEmpty(request.LastName)) { return RosterSearchByGradeLevel(request); } if (request.GradeLevel == null) { return RosterSearchByLastName(request); } return RosterSearchByLastNameAndGradeLevel(request); }
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); }