public async Task <ActionResult> DeleteConfirmed(int id) { TeamAssignmentHistory teamAssignmentHistory = await db.TeamAssignmentHistories.FindAsync(id); db.TeamAssignmentHistories.Remove(teamAssignmentHistory); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,AssignedBy,DateAssigned,ServiceRequest,Team")] TeamAssignmentHistory teamAssignmentHistory) { if (ModelState.IsValid) { db.Entry(teamAssignmentHistory).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.ServiceRequest = new SelectList(db.ServiceRequests, "Id", "RequestHeading", teamAssignmentHistory.ServiceRequest); ViewBag.Team = new SelectList(db.Teams, "Id", "TeamDescription", teamAssignmentHistory.Team); return(View(teamAssignmentHistory)); }
// GET: TeamAssignmentHistories/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TeamAssignmentHistory teamAssignmentHistory = await db.TeamAssignmentHistories.FindAsync(id); if (teamAssignmentHistory == null) { return(HttpNotFound()); } return(View(teamAssignmentHistory)); }
// GET: TeamAssignmentHistories/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TeamAssignmentHistory teamAssignmentHistory = await db.TeamAssignmentHistories.FindAsync(id); if (teamAssignmentHistory == null) { return(HttpNotFound()); } ViewBag.ServiceRequest = new SelectList(db.ServiceRequests, "Id", "RequestHeading", teamAssignmentHistory.ServiceRequest); ViewBag.Team = new SelectList(db.Teams, "Id", "TeamDescription", teamAssignmentHistory.Team); return(View(teamAssignmentHistory)); }