Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Teacher_Profile teacher_profile = db.Teacher_Profile.Find(id);

            db.Teacher_Profile.Remove(teacher_profile);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        //
        // GET: /Teacher_Profile/Details/5

        public ActionResult Details(int id = 0)
        {
            Teacher_Profile teacher_profile = db.Teacher_Profile.Find(id);

            if (teacher_profile == null)
            {
                return(HttpNotFound());
            }
            return(View(teacher_profile));
        }
Exemplo n.º 3
0
 public ActionResult Edit(Teacher_Profile teacher_profile)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher_profile).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.School_ID = new SelectList(db.School_Profile, "School_ID", "SchoolAdmin_username", teacher_profile.School_ID);
     return(View(teacher_profile));
 }
Exemplo n.º 4
0
        //
        // GET: /Teacher_Profile/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Teacher_Profile teacher_profile = db.Teacher_Profile.Find(id);

            if (teacher_profile == null)
            {
                return(HttpNotFound());
            }
            ViewBag.School_ID = new SelectList(db.School_Profile, "School_ID", "SchoolAdmin_username", teacher_profile.School_ID);
            return(View(teacher_profile));
        }
Exemplo n.º 5
0
        public ActionResult Create(Teacher_Profile teacher_profile)
        {
            if (ModelState.IsValid)
            {
                db.Teacher_Profile.Add(teacher_profile);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.School_ID = new SelectList(db.School_Profile, "School_ID", "SchoolAdmin_username", teacher_profile.School_ID);
            return(View(teacher_profile));
        }