public ActionResult ClassesPage() { ClassSevice classService = new ClassSevice(); List <Classes> allClasses = classService.GetAllClasses(); return(View(allClasses)); }
public ActionResult DeleteClass(int classId) { ClassSevice classService = new ClassSevice(); classService.DeleteClass(classId); return(RedirectToAction("ClassesPage")); }
public ActionResult AddClass(Classes classes) { try { ClassSevice classService = new ClassSevice(); classService.AddClass(classes); return(RedirectToAction("ClassesPage")); } catch { return(View()); } }
public ActionResult StudentRegistration() { List <SelectListItem> selectListItemsClasses = new List <SelectListItem>(); ClassSevice classService = new ClassSevice(); List <Classes> allClasses = classService.GetAllClasses(); foreach (Classes classes in allClasses) { selectListItemsClasses.Add(new SelectListItem() { Text = classes.Class, Value = classes.ClassId.ToString() }); } ViewBag.Classes = selectListItemsClasses; return(View()); }