public async Task <IActionResult> Edit(int id, [Bind("FieldBlockId,BlockChar,YearCreated,BlockDescription")] PtsFieldBlock ptsFieldBlock) { if (id != ptsFieldBlock.FieldBlockId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ptsFieldBlock); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PtsFieldBlockExists(ptsFieldBlock.FieldBlockId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ptsFieldBlock)); }
public async Task <IActionResult> Create([Bind("FieldBlockId,BlockChar,YearCreated,BlockDescription")] PtsFieldBlock ptsFieldBlock) { if (ModelState.IsValid) { _context.Add(ptsFieldBlock); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ptsFieldBlock)); }