public async Task <IActionResult> Create([Bind("StudentId,FirstName,LastName,Program")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("TeacherId,FirstName,LastName,TeacherResume,School,Department")] Teacher teacher) { if (ModelState.IsValid) { _context.Add(teacher); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(teacher)); }
public async Task<IActionResult> Create([Bind("CourseCode,StudentId,TeacherId,CourseTitle")] Course course) { if (ModelState.IsValid) { _context.Add(course); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } ViewData["StudentId"] = new SelectList(_context.Student, "StudentId", "StudentId", course.StudentId); ViewData["TeacherId"] = new SelectList(_context.Teacher, "TeacherId", "TeacherId", course.TeacherId); return View(course); }
public async Task <IActionResult> Create([Bind("RatingId,StudentId,Comment")] Rating rating) { if (ModelState.IsValid) { _context.Add(rating); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StudentId"] = new SelectList(_context.Student, "StudentId", "StudentId", rating.StudentId); return(View(rating)); }
public async Task <IActionResult> Create([Bind("LoginName,Password")] Login login) { if (ModelState.IsValid) { _context.Add(login); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LoginName"] = new SelectList(_context.Student, "StudentId", "StudentId", login.LoginName); return(View(login)); }
public async Task <IActionResult> Create([Bind("AppoinmentId,StudentId,TeacherId,AppoinmentDate,AppoinmentTime,AppoinmentCoz")] Appoinment appoinment) { if (ModelState.IsValid) { _context.Add(appoinment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StudentId"] = new SelectList(_context.Student, "StudentId", "StudentId", appoinment.StudentId); ViewData["TeacherId"] = new SelectList(_context.Teacher, "TeacherId", "TeacherId", appoinment.TeacherId); return(View(appoinment)); }