public async Task <IActionResult> Edit(int id, [Bind("ProgressEmployeeId,FullName,Progress,EmployeeId")] ProgressEmployee progressEmployee) { if (id != progressEmployee.ProgressEmployeeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(progressEmployee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProgressEmployeeExists(progressEmployee.ProgressEmployeeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", progressEmployee.EmployeeId); return(View(progressEmployee)); }
public async Task <IActionResult> Create([Bind("ProgressEmployeeId,FullName,Progress,EmployeeId")] ProgressEmployee progressEmployee) { if (ModelState.IsValid) { _context.Add(progressEmployee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", progressEmployee.EmployeeId); return(View(progressEmployee)); }