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

            db.TeacherSkill.Remove(teacherSkill);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ID,TeacherID,SkillID,PersonID")] TeacherSkill teacherSkill)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacherSkill).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SkillID   = new SelectList(db.Skill, "ID", "SkillName", teacherSkill.SkillID);
     ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", teacherSkill.TeacherID);
     return(View(teacherSkill));
 }
Exemple #3
0
        // GET: TeacherSkills/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TeacherSkill teacherSkill = db.TeacherSkill.Find(id);

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

            if (teacherSkill == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SkillID   = new SelectList(db.Skill, "ID", "SkillName", teacherSkill.SkillID);
            ViewBag.TeacherID = new SelectList(db.Teacher, "ID", "FirstName", teacherSkill.TeacherID);
            return(View(teacherSkill));
        }