Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SupportingTeacher supportingTeacher = db.SupportingTeacher.Find(id);

            db.SupportingTeacher.Remove(supportingTeacher);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ID,ModuleID,TeacherID")] SupportingTeacher supportingTeacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(supportingTeacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ModuleID  = new SelectList(db.Module, "ID", "ModuleCode", supportingTeacher.ModuleID);
     ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", supportingTeacher.TeacherID);
     return(View(supportingTeacher));
 }
Exemple #3
0
        public ActionResult AddSupportingTeacher(int moduleID, int teacherID)
        {
            SupportingTeacher teacher = new SupportingTeacher();

            teacher.ModuleID  = moduleID;
            teacher.TeacherID = teacherID;
            if (ModelState.IsValid)
            {
                db.SupportingTeacher.Add(teacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Exemple #4
0
        // GET: SupportingTeachers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SupportingTeacher supportingTeacher = db.SupportingTeacher.Find(id);

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

            if (supportingTeacher == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ModuleID  = new SelectList(db.Module, "ID", "ModuleCode", supportingTeacher.ModuleID);
            ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", supportingTeacher.TeacherID);
            return(View(supportingTeacher));
        }