public async Task <IActionResult> Edit(int id, [Bind("ID,PatientID,CreatedDate,Weight_lb,Height_cm,Blood_Sugar,Blood_Pressure,Symptoms,Diagnosis,Prescription,Comments")] MedicalHistoryVM medicalHistoryVM) { if (id != medicalHistoryVM.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicalHistoryVM); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicalHistoryVMExists(medicalHistoryVM.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(medicalHistoryVM)); }
public async Task <IActionResult> Create([Bind("ID,PatientID,CreatedDate,Weight_lb,Height_cm,Blood_Sugar,Blood_Pressure,Symptoms,Diagnosis,Prescription,Comments")] MedicalHistoryVM medicalHistoryVM) { if (ModelState.IsValid) { _context.Add(medicalHistoryVM); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(medicalHistoryVM)); }