コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AspNetLessonPlanBreakdownHeading aspNetLessonPlanBreakdownHeading = db.AspNetLessonPlanBreakdownHeadings.Find(id);

            db.AspNetLessonPlanBreakdownHeadings.Remove(aspNetLessonPlanBreakdownHeading);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,BreakDownHeadingName")] AspNetLessonPlanBreakdownHeading aspNetLessonPlanBreakdownHeading)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetLessonPlanBreakdownHeading).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetLessonPlanBreakdownHeading));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,BreakDownHeadingName")] AspNetLessonPlanBreakdownHeading aspNetLessonPlanBreakdownHeading)
        {
            if (ModelState.IsValid)
            {
                db.AspNetLessonPlanBreakdownHeadings.Add(aspNetLessonPlanBreakdownHeading);
                db.SaveChanges();
                return(RedirectToAction("Index", "AspNetLessonPlanBreakdownHeading"));
            }

            return(View(aspNetLessonPlanBreakdownHeading));
        }
コード例 #4
0
        // GET: AspNetLessonPlanBreakdownHeading/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AspNetLessonPlanBreakdownHeading aspNetLessonPlanBreakdownHeading = db.AspNetLessonPlanBreakdownHeadings.Find(id);

            if (aspNetLessonPlanBreakdownHeading == null)
            {
                return(HttpNotFound());
            }
            return(View(aspNetLessonPlanBreakdownHeading));
        }
コード例 #5
0
        public ActionResult DeleteCnfm(int id)
        {
            AspNetLessonPlanBreakdownHeading aspNetLessonPlanBreakdownHeading = db.AspNetLessonPlanBreakdownHeadings.Find(id);

            try
            {
                db.AspNetLessonPlanBreakdownHeadings.Remove(aspNetLessonPlanBreakdownHeading);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                ViewBag.Error = "It can't be deleted";
                return(View("Details", aspNetLessonPlanBreakdownHeading));
            }
        }