public async Task <IActionResult> Edit(int id, [Bind("Id,PersonId,Date,BodyTemp,SoreThroat,NasalCongestion,Cough,Headache,Nausea,Diarrhea,MuscleAches,OtherSymptoms,OtherSymptomsDescription,FamilySymtoms")] MDProtocol mDProtocol) { if (id != mDProtocol.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mDProtocol); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MDProtocolExists(mDProtocol.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PersonId"] = new SelectList(_context.Person, "Id", "FullName", mDProtocol.PersonId); return(View(mDProtocol)); }
public async Task <IActionResult> Create([Bind("Id,PersonId,Date,BodyTemp,SoreThroat,NasalCongestion,Cough,Headache,Nausea,Diarrhea,MuscleAches,OtherSymptoms,OtherSymptomsDescription,FamilySymtoms")] MDProtocol mDProtocol) { if (ModelState.IsValid) { _context.Add(mDProtocol); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PersonId"] = new SelectList(_context.Person, "Id", "FullName", mDProtocol.PersonId); return(View(mDProtocol)); }