예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StudentPetition studentPetition = db.StudentPetition.Find(id);

            db.StudentPetition.Remove(studentPetition);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "StudentPetitionID,Status,SubmitDate,StudentID,PetitionID")] StudentPetition studentPetition)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentPetition).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PetitionID = new SelectList(db.Petition, "PetitionID", "Name", studentPetition.PetitionID);
     ViewBag.StudentID  = new SelectList(db.Student, "StudentId", "FirstName", studentPetition.StudentID);
     return(View(studentPetition));
 }
예제 #3
0
        // GET: AdminStudentPetitions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentPetition studentPetition = db.StudentPetition.Find(id);

            if (studentPetition == null)
            {
                return(HttpNotFound());
            }
            return(View(studentPetition));
        }
예제 #4
0
        // GET: AdminStudentPetitions/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentPetition studentPetition = db.StudentPetition.Find(id);

            if (studentPetition == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PetitionID = new SelectList(db.Petition, "PetitionID", "Name", studentPetition.PetitionID);
            ViewBag.StudentID  = new SelectList(db.Student, "StudentId", "FirstName", studentPetition.StudentID);
            return(View(studentPetition));
        }