예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }