public async Task <IActionResult> Create([Bind("Id,Tutor_Name,Tutor_Address,Tutor_Contact")] Tutor tutor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tutor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tutor));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,School_Name,School_Branch")] School school)
        {
            if (ModelState.IsValid)
            {
                _context.Add(school);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(school));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("Id,Student_Name,Student_Address,Student_Contact,TutorID")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TutorID"] = new SelectList(_context.Tutor, "Id", "Id", student.TutorID);
            return(View(student));
        }