public async Task <IActionResult> Edit(int id, [Bind("HospitalAdmitId,PatientId,EmployerId,EmergencyContactId,InsuranceId,PolicyHolderId")] HospitalAdmitCard hospitalAdmitCard) { if (id != hospitalAdmitCard.HospitalAdmitId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hospitalAdmitCard); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HospitalAdmitCardExists(hospitalAdmitCard.HospitalAdmitId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hospitalAdmitCard)); }
public async Task <IActionResult> Create([Bind("HospitalAdmitId,PatientId,EmployerId,EmergencyContactId,InsuranceId,PolicyHolderId")] HospitalAdmitCard hospitalAdmitCard) { if (ModelState.IsValid) { _context.Add(hospitalAdmitCard); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hospitalAdmitCard)); }