public async Task <IActionResult> Edit(int id, [Bind("ID,P_patient_id,Full_names,S_patient_id,Phone_number")] SuspectedCases suspectedCases) { if (id != suspectedCases.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(suspectedCases); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SuspectedCasesExists(suspectedCases.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(suspectedCases)); }
public async Task <IActionResult> Create([Bind("ID,P_patient_id,Full_names,S_patient_id,Phone_number")] SuspectedCases suspectedCases) { if (ModelState.IsValid) { _context.Add(suspectedCases); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(suspectedCases)); }