public async Task <IActionResult> Edit(int id, [Bind("TreatmentTypeId,TreatmentTypeName")] PtsTreatmentType ptsTreatmentType) { if (id != ptsTreatmentType.TreatmentTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsTreatmentType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsTreatmentTypeExists(ptsTreatmentType.TreatmentTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsTreatmentType)); }
public async Task <IActionResult> Create([Bind("TreatmentTypeId,TreatmentTypeName")] PtsTreatmentType ptsTreatmentType) { if (ModelState.IsValid) { _context.Add(ptsTreatmentType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ptsTreatmentType)); }