Пример #1
0
        public ActionResult ClassesPage()
        {
            ClassSevice    classService = new ClassSevice();
            List <Classes> allClasses   = classService.GetAllClasses();

            return(View(allClasses));
        }
Пример #2
0
        public ActionResult DeleteClass(int classId)
        {
            ClassSevice classService = new ClassSevice();

            classService.DeleteClass(classId);

            return(RedirectToAction("ClassesPage"));
        }
Пример #3
0
        public ActionResult AddClass(Classes classes)
        {
            try
            {
                ClassSevice classService = new ClassSevice();
                classService.AddClass(classes);

                return(RedirectToAction("ClassesPage"));
            }
            catch
            {
                return(View());
            }
        }
Пример #4
0
        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());
        }