public async Task <IActionResult> Edit(string id, [Bind("Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] AspNetUsers aspNetUsers) { if (id != aspNetUsers.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aspNetUsers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AspNetUsersExists(aspNetUsers.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(aspNetUsers)); }
public async Task <IActionResult> Edit(string id, [Bind("Age,Attrition,BusinessTravel,DailyRate,Department,DistanceFromHome,Education,EducationField,EmployeeCount,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,StandardHours,StockOptionLevel,TotalWorkingYears,TrainingTimesLastYear,WorkLifeBalance,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager")] WikiEmployeeData wikiEmployeeData) { if (id != wikiEmployeeData.EmployeeNumber) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wikiEmployeeData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WikiEmployeeDataExists(wikiEmployeeData.EmployeeNumber)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(wikiEmployeeData)); }
public async Task <IActionResult> Edit(string id, [Bind("UserId,RoleId")] AspNetUserRoles aspNetUserRoles) { if (id != aspNetUserRoles.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aspNetUserRoles); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AspNetUserRolesExists(aspNetUserRoles.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["RoleId"] = new SelectList(_context.AspNetRoles, "Id", "Id", aspNetUserRoles.RoleId); ViewData["UserId"] = new SelectList(_context.AspNetUsers, "Id", "Id", aspNetUserRoles.UserId); return(View(aspNetUserRoles)); }