public async Task <IActionResult> Create([Bind("RedemptionId,Code,BookTitle,Isbn")] Redemption redemption) { if (ModelState.IsValid) { _context.Add(redemption); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(redemption)); }
public async Task <IActionResult> Create([Bind("StudentId,FirstName,LastName,Grade")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("IssuranceId,StudentId,RedemptionId")] Issurance issurance) { if (ModelState.IsValid) { _context.Add(issurance); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["RedemptionId"] = new SelectList(_context.Redemption, "RedemptionId", "RedemptionId", issurance.RedemptionId); ViewData["StudentId"] = new SelectList(_context.Student, "StudentId", "StudentId", issurance.StudentId); return(View(issurance)); }