public async Task <IActionResult> Edit(int id, [Bind("RoleId,Role,Active,Discription,CreatedBy,CreatedDate")] TblRole tblRole) { if (id != tblRole.RoleId) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(tblRole); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblRoleExists(tblRole.RoleId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblRole)); }
public async Task <IActionResult> Edit(decimal id, [Bind("UserId,Username,Password,Lock,RoleId,CreatedBy,CreatedDate")] TblUser tblUser) { if (id != tblUser.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(tblUser); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblUserExists(tblUser.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblUser)); }