public ActionResult EnrollInClass() { var model = new IndividualClassModel(); model.classes = GetAllClasses(); return(View(model)); }
public ActionResult studentclasses(IndividualClassModel model) { var user = (LearningCenter.Website.Models.UserModel)Session["User"]; var classes = individualClassRepository.ClassList(user.Id); var model1 = new ClassListViewModel { ClassLists = classes }; return(View(model1)); }
public ActionResult EnrollInClass(IndividualClassModel model) { var user = (LearningCenter.Website.Models.UserModel)Session["User"]; model.classes = GetAllClasses(); if (ModelState.IsValid) { individualClassRepository.Add(user.Id, model.ClassId); return(RedirectToAction("studentclasses")); } return(View()); }