Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id);

            _db.tblClassTeachers.Remove(tblclassteacher);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ClassTeacherId,ClassId,UserId,CreateDatetime,ChangeDatetime")] tblClassTeacher tblclassteacher)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(tblclassteacher).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClassId = new SelectList(_db.tblClasses, "ClassId", "ClassDesc", tblclassteacher.ClassId);
     ViewBag.UserId  = new SelectList(_db.tblUsers, "UserId", "UserEmail", tblclassteacher.UserId);
     return(View(tblclassteacher));
 }
Exemple #3
0
        // GET: /Default1/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id);

            if (tblclassteacher == null)
            {
                return(HttpNotFound());
            }
            return(View(tblclassteacher));
        }
Exemple #4
0
        // GET: /Default1/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblClassTeacher tblclassteacher = _db.tblClassTeachers.Find(id);

            if (tblclassteacher == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClassId = new SelectList(_db.tblClasses, "ClassId", "ClassDesc", tblclassteacher.ClassId);
            ViewBag.UserId  = new SelectList(_db.tblUsers, "UserId", "UserEmail", tblclassteacher.UserId);
            return(View(tblclassteacher));
        }