public async Task <IActionResult> Edit(double?id, [Bind("Age,BusinessTravel,Department,DistanceFromHome,EducationField,EmployeeNumber,Gender,JobRole,MaritalStatus,NumCompaniesWorked,OverTime,TotalWorkingYears,TrainingTimesLastYear,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager")] HumanResourceTable humanResourceTable) { if (id != humanResourceTable.EmployeeNumber) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(humanResourceTable); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HumanResourceTableExists(humanResourceTable.EmployeeNumber)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(humanResourceTable)); }
public async Task <IActionResult> Create([Bind("Age,BusinessTravel,Department,DistanceFromHome,EducationField,EmployeeNumber,Gender,JobRole,MaritalStatus,NumCompaniesWorked,OverTime,TotalWorkingYears,TrainingTimesLastYear,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager")] HumanResourceTable humanResourceTable) { if (ModelState.IsValid) { _context.Add(humanResourceTable); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(humanResourceTable)); }