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

            db.Teacher_Class.Remove(teacher_Class);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,TeacherId,ClassId")] Teacher_Class teacher_Class)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher_Class).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClassId   = new SelectList(db.Classes, "Id", "ClassTitle", teacher_Class.ClassId);
     ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "FirstName", teacher_Class.TeacherId);
     return(View(teacher_Class));
 }
예제 #3
0
        // GET: Teacher_Class/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teacher_Class teacher_Class = db.Teacher_Class.Find(id);

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

            if (teacher_Class == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClassId   = new SelectList(db.Classes, "Id", "ClassTitle", teacher_Class.ClassId);
            ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "FirstName", teacher_Class.TeacherId);
            return(View(teacher_Class));
        }