public async Task <IActionResult> Edit(int id, [Bind("StdHistoryId,StdType,StdDateOfDiagnosis,StdStatus,StdDateResolved,StdMedication,Comments")] Stdhistory stdhistory) { if (id != stdhistory.StdHistoryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(stdhistory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StdhistoryExists(stdhistory.StdHistoryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(stdhistory)); }
public async Task <IActionResult> Create([Bind("StdHistoryId,StdType,StdDateOfDiagnosis,StdStatus,StdDateResolved,StdMedication,Comments")] Stdhistory stdhistory) { if (ModelState.IsValid) { _context.Add(stdhistory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(stdhistory)); }