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

            db.SchoolTeachers.Remove(schoolteacher);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "SchoolDesc,FirstName,LastName,SchoolId,RoleId,UserEmail,UserId")] SchoolTeacher schoolteacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(schoolteacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(schoolteacher));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "SchoolDesc,FirstName,LastName,SchoolId,RoleId,UserEmail,UserId")] SchoolTeacher schoolteacher)
        {
            if (ModelState.IsValid)
            {
                db.SchoolTeachers.Add(schoolteacher);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(schoolteacher));
        }
コード例 #4
0
        // GET: /SchoolAdminView/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SchoolTeacher schoolteacher = db.SchoolTeachers.Find(id);

            if (schoolteacher == null)
            {
                return(HttpNotFound());
            }
            return(View(schoolteacher));
        }