public async Task <IActionResult> Edit(int id, [Bind("Id,Date,DayOfWeek,Description,CreatedById")] Hollyday hollyday) { if (id != hollyday.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hollyday); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HollydayExists(hollyday.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CreatedById"] = new SelectList(_context.Employees, "Id", "Id", hollyday.CreatedById); return(View(hollyday)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,TimeStamp,Status,PercentageOfWorkCompleted,AssignedToId,AssignedById,TaskId")] TaskSnapShot taskSnapShot) { if (id != taskSnapShot.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(taskSnapShot); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskSnapShotExists(taskSnapShot.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AssignedById"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedById); ViewData["AssignedToId"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedToId); ViewData["TaskId"] = new SelectList(_context.Tasks, "Id", "Id", taskSnapShot.TaskId); return(View(taskSnapShot)); }
public async Task <IActionResult> Edit(int id, [Bind("Role,Id,UserId,FirstName,LastName,WebPageAddress,Address,MobilePhoneNo,OfficePhoneNo,HomePhoneNo,FaxNo,TeamId,SeniorId")] 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))); } ViewData["SeniorId"] = new SelectList(_context.Employees, "Id", "Id", employee.SeniorId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", employee.TeamId); return(View(employee)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Team team) { if (id != team.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(team); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeamExists(team.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(team)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,TeamId,HollydayId")] HollydayTeam hollydayTeam) { if (id != hollydayTeam.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hollydayTeam); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HollydayTeamExists(hollydayTeam.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["HollydayId"] = new SelectList(_context.HollyDays, "Id", "Id", hollydayTeam.HollydayId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", hollydayTeam.TeamId); return(View(hollydayTeam)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,StartDate,EndDate,MonthId,YearId,TeamId")] BusinessDay businessDay) { if (id != businessDay.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(businessDay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessDayExists(businessDay.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", businessDay.TeamId); return(View(businessDay)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CreatedOn,Priority,BusinessDT,Title,Description,IsCommissioned,PrimaryOwnerId,SecondaryOwnerId,ReviewerId,TeamId")] Server.Models.Task task) { if (id != task.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(task); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskExists(task.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PrimaryOwnerId"] = new SelectList(_context.Employees, "Id", "Id", task.PrimaryOwnerId); ViewData["ReviewerId"] = new SelectList(_context.Employees, "Id", "Id", task.ReviewerId); ViewData["SecondaryOwnerId"] = new SelectList(_context.Employees, "Id", "Id", task.SecondaryOwnerId); ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", task.TeamId); return(View(task)); }