コード例 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            Teacher_Teaches_subject teacher_Teaches_subject = db.Teacher_Teaches_subject.Find(id);

            db.Teacher_Teaches_subject.Remove(teacher_Teaches_subject);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TSRating,TID,SubID")] Teacher_Teaches_subject teacher_Teaches_subject)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher_Teaches_subject).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SubID = new SelectList(db.Subjects, "SubID", "SubName", teacher_Teaches_subject.SubID);
     ViewBag.TID   = new SelectList(db.Teachers, "TID", "Name", teacher_Teaches_subject.TID);
     return(View(teacher_Teaches_subject));
 }
コード例 #3
0
        // GET: Teacher_Teaches_subject/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teacher_Teaches_subject teacher_Teaches_subject = db.Teacher_Teaches_subject.Find(id);

            if (teacher_Teaches_subject == null)
            {
                return(HttpNotFound());
            }
            return(View(teacher_Teaches_subject));
        }
コード例 #4
0
        // GET: Teacher_Teaches_subject/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teacher_Teaches_subject teacher_Teaches_subject = db.Teacher_Teaches_subject.Find(id);

            if (teacher_Teaches_subject == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SubID = new SelectList(db.Subjects, "SubID", "SubName", teacher_Teaches_subject.SubID);
            ViewBag.TID   = new SelectList(db.Teachers, "TID", "Name", teacher_Teaches_subject.TID);
            return(View(teacher_Teaches_subject));
        }