public async Task<IActionResult> Create([Bind("ID,NRIC,Name,Gender,DateOfBirth,Address,History")] Patients patients) { if (ModelState.IsValid) { _context.Add(patients); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(patients); }
public async Task <IActionResult> CreateHistory([Bind("ID,Patient,DateOfVisit,Illness,MedicationGiven,Price,Status")] History history) { if (ModelState.IsValid) { _context.Add(history); await _context.SaveChangesAsync(); return(RedirectToAction("History", "Patients")); } return(RedirectToAction("History", "Patients")); }