Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id);

            db.AttendanceIssues.Remove(attendanceIssue);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "AttendanceIssueId,PersonId,SchoolId,IsResolved,ResolvedDate,Comment")] AttendanceIssue attendanceIssue)
 {
     if (ModelState.IsValid)
     {
         db.Entry(attendanceIssue).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PersonId = new SelectList(db.Persons, "PersonId", "GivenName", attendanceIssue.PersonId);
     ViewBag.SchoolId = new SelectList(db.Schools, "SchoolId", "Name", attendanceIssue.SchoolId);
     return(View(attendanceIssue));
 }
Exemple #3
0
        // GET: AttendanceIssues/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id);

            if (attendanceIssue == null)
            {
                return(HttpNotFound());
            }
            return(View(attendanceIssue));
        }
Exemple #4
0
        // GET: AttendanceIssues/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id);

            if (attendanceIssue == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PersonId = new SelectList(db.Persons, "PersonId", "GivenName", attendanceIssue.PersonId);
            ViewBag.SchoolId = new SelectList(db.Schools, "SchoolId", "Name", attendanceIssue.SchoolId);
            return(View(attendanceIssue));
        }