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