public async Task <IActionResult> Edit(int id, [Bind("ZopotherId,opother")] Zopother zopother) { if (id != zopother.ZopotherId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zopother); TempData["Alert"] = String.Format("Saved Changes to OP Other: {0}", zopother.opother); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZopotherExists(zopother.ZopotherId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zopother)); }
public async Task <IActionResult> Create([Bind("ZopotherId,opother")] Zopother zopother) { if (ModelState.IsValid) { _context.Add(zopother); TempData["Alert"] = String.Format("Added OP Other: {0}", zopother.opother); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(zopother)); }