Пример #1
0
        public async Task <IActionResult> Create([Bind("StudentID,UserName,FirstName,LastName,PhoneNumber,Address,Password,IsAdmin")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("CourseID,CourseName,Category")] Course course)
        {
            if (ModelState.IsValid)
            {
                _context.Add(course);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(course));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("EnrollmentID,EnrollmentDate,FinalGrade")] Enrollment enrollment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(enrollment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(enrollment));
        }