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)); }