示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SubjectChapterSetup subjectChapterSetup = db.SubjectChapterSetups.Find(id);

            db.SubjectChapterSetups.Remove(subjectChapterSetup);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,ClassId,SubjectId,Name,IsActive")] SubjectChapterSetup subjectChapterSetup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subjectChapterSetup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClassId   = new SelectList(db.Classes.ToList().OrderByDescending(s => s.Id), "Id", "Name", subjectChapterSetup.ClassId);;
     ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", subjectChapterSetup.SubjectId);
     return(View(subjectChapterSetup));
 }
示例#3
0
        // GET: SubjectChapterSetups/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SubjectChapterSetup subjectChapterSetup = db.SubjectChapterSetups.Find(id);

            if (subjectChapterSetup == null)
            {
                return(HttpNotFound());
            }
            return(View(subjectChapterSetup));
        }
示例#4
0
        public ActionResult Create([Bind(Include = "Id,SubjectId,Name,IsActive,ClassId")] SubjectChapterSetup subjectChapterSetup)
        {
            ViewBag.ClassId   = new SelectList(db.Classes.ToList().OrderByDescending(s => s.Id), "Id", "Name", subjectChapterSetup.ClassId);
            ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", subjectChapterSetup.SubjectId);

            if (ModelState.IsValid)
            {
                db.SubjectChapterSetups.Add(subjectChapterSetup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }


            return(View(subjectChapterSetup));
        }
示例#5
0
        // GET: SubjectChapterSetups/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SubjectChapterSetup subjectChapterSetup = db.SubjectChapterSetups.Find(id);

            if (subjectChapterSetup == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClassId   = new SelectList(db.Classes.ToList().OrderByDescending(s => s.Id), "Id", "Name", subjectChapterSetup.ClassId);
            ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", subjectChapterSetup.SubjectId);
            return(View(subjectChapterSetup));
        }