public async Task <IActionResult> Edit(int id, [Bind("VacDoneID,MotherID")] VacDone vacDone) { if (id != vacDone.VacDoneID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vacDone); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VacDoneExists(vacDone.VacDoneID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["MotherID"] = new SelectList(_context.Mothers, "MotherID", "MotherID", vacDone.MotherID); return(View(vacDone)); }
public async Task <IActionResult> Create([Bind("VacDoneID,MotherID")] VacDone vacDone) { if (ModelState.IsValid) { _context.Add(vacDone); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["MotherID"] = new SelectList(_context.Mothers, "MotherID", "MotherID", vacDone.MotherID); return(View(vacDone)); }