public async Task <IActionResult> Edit(int id, [Bind("AddressAccountId,AccountName,Manager,Department,Branch")] PsnAddressAccount psnAddressAccount) { if (id != psnAddressAccount.AddressAccountId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(psnAddressAccount); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PsnAddressAccountExists(psnAddressAccount.AddressAccountId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(PartialView("~/Areas/Personnel/Views/PsnAddressAccount/CreateEdit.cshtml", psnAddressAccount)); }
public async Task <IActionResult> Create([Bind("AddressAccountId,AccountName,Manager,Department,Branch")] PsnAddressAccount psnAddressAccount) { if (ModelState.IsValid) { _context.Add(psnAddressAccount); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(PartialView("~/Areas/Personnel/Views/PsnAddressAccount/CreateEdit.cshtml", psnAddressAccount)); }