public async Task <IActionResult> Edit(int id, [Bind("Id,RoleName,Details,Status")] Role role) { if (id != role.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(role); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoleExists(role.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(role)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ControllerId,ActionTitle,ActionName")] AuthAction authAction) { if (id != authAction.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(authAction); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AuthActionExists(authAction.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(authAction)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,StateId,CityName,City3Code,City2Code,Status")] City city) { if (id != city.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(city); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CityExists(city.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(city)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,StateName,State3Code,State2Code,Ordering,Status")] State state) { if (id != state.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(state); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StateExists(state.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(state)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,Address,Email,Phone")] Company company) { if (id != company.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(company); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(company.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(company)); }