public async Task <IActionResult> Edit(int id, [Bind("TID,Tasks")] TaskProject taskProject) { if (id != taskProject.TID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(taskProject); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskProjectExists(taskProject.TID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(taskProject)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Name,Surname,Nickname,Position,Active")] employee employee) { if (id != employee.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!employeeExists(employee.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Edit(string id, [Bind("ID,Title,Name,Surname,Nickname,Position,StartDate,EndDate,Tel,Email,Active")] outsource outsource) { if (id != outsource.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(outsource); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!outsourceExists(outsource.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(outsource)); }
public async Task <IActionResult> Edit(int id, [Bind("ProjID,Name,Partner,Customer,StartDate")] project project) { if (id != project.ProjID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(project); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!projectExists(project.ProjID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(project)); }
public async Task <IActionResult> Edit(int id, [Bind("PID,Phase,FromDate,EndDate,Usage")] PhaseProject phaseProject) { if (id != phaseProject.PID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(phaseProject); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhaseProjectExists(phaseProject.PID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(phaseProject)); }
public async Task <IActionResult> Edit(int id, [Bind("LID,StartDate,EndDate,note,Days")] Leave Leave) { if (id != Leave.LID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(Leave); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeaveExists(Leave.LID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(Leave)); }
public async Task <IActionResult> Edit(int?id, [Bind("ID,Position,Description")] Positions positions) { if (id != positions.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(positions); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PositionExists(positions.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(positions)); }