public ActionResult ClassRoster(int id)
 {
     var uberModel = new UberRoster();
        // uberModel.SearchRequest.ClassId = id;
     uberModel.ClassId = id;
     uberModel.CourseName = _teacherRepository.GetCourseById(id).Name;
     uberModel.EnrolledStudents = _rosterRepository.GetStudentsEnrolledIn(id);
     uberModel.SearchResults = new List<RosterSearchRecord>();
     uberModel.SearchRequest = new RosterSearchRequest();
     return View(uberModel);
 }
        public ActionResult AddStudent(string userId, int classId)
        {
            var uberModel = new UberRoster();
            var addRequest = new RosterAddRequest();
            addRequest.UserId = userId;
               // addRequest.RosterId = rosterId;

            addRequest.ClassId = classId;
            _rosterRepository.AddToRoster(addRequest);
            uberModel.CourseName = _teacherRepository.GetCourseById(classId).Name;
            uberModel.ClassId = classId;
            uberModel.EnrolledStudents = _rosterRepository.GetStudentsEnrolledIn(classId);
            uberModel.SearchResults = new List<RosterSearchRecord>();
            uberModel.SearchRequest = new RosterSearchRequest();

            return View("ClassRoster", uberModel);
        }
 public ActionResult DeleteStudent(int rosterId, int classId)
 {
     var uberModel = new UberRoster();
     _rosterRepository.DeleteStudent(rosterId);
     uberModel.CourseName = _teacherRepository.GetCourseById(classId).Name;
     uberModel.EnrolledStudents = _rosterRepository.GetStudentsEnrolledIn(classId);
     uberModel.SearchResults = new List<RosterSearchRecord>();
     uberModel.SearchRequest = new RosterSearchRequest();
     return View("ClassRoster", uberModel);
 }
        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);
        }