コード例 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            TeamAssignmentHistory teamAssignmentHistory = await db.TeamAssignmentHistories.FindAsync(id);

            db.TeamAssignmentHistories.Remove(teamAssignmentHistory);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        // 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));
        }