Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id);

            db.ExtraMuralAgeGroups.Remove(extraMuralAgeGroups);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "MuralAgeGroupId,MuralName,ExtraMuralId,ExtraMuralName,AgeGroupName,NoAssignedStudents,StaffId,AssignedTeacher")] ExtraMuralAgeGroups extraMuralAgeGroups)
 {
     if (ModelState.IsValid)
     {
         db.Entry(extraMuralAgeGroups).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId);
     ViewBag.StaffId      = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId);
     return(View(extraMuralAgeGroups));
 }
Example #3
0
        // GET: ExtraMuralAgeGroups1/Create
        public ActionResult Create()
        {
            Dictionary <int, string> teacherCollection = GetTeacherNameComboCollection();

            var mural = new ExtraMuralAgeGroups
            {
                TeacherNameCollection = teacherCollection.Values.ToList()
            };


            ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName");
            ViewBag.StaffId      = new SelectList(db.Staffs, "StaffId", "Title");
            return(View(mural));
        }
Example #4
0
        // GET: ExtraMuralAgeGroups1/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id);

            if (extraMuralAgeGroups == null)
            {
                return(HttpNotFound());
            }
            return(View(extraMuralAgeGroups));
        }
Example #5
0
        public ActionResult Edit([Bind(Include = "MuralAgeGroupId,ExtraMuralId,ExtraMuralName,AgeGroupName,NoAssignedStudents,StaffId,AssignedTeacher")] ExtraMuralAgeGroups extraMuralAgeGroups)
        {
            Dictionary <int, string> teacherCollection = GetTeacherNameComboCollection();

            extraMuralAgeGroups.TeacherNameCollection = teacherCollection.Values.ToList();

            if (ModelState.IsValid)
            {
                db.Entry(extraMuralAgeGroups).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId);
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId);
            return(View(extraMuralAgeGroups));
        }
Example #6
0
        // GET: ExtraMuralAgeGroups/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id);

            if (extraMuralAgeGroups == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId);
            ViewBag.StaffId      = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId);
            return(View(extraMuralAgeGroups));
        }
Example #7
0
        // GET: ExtraMuralAgeGroups1/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExtraMuralAgeGroups      extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id);
            Dictionary <int, string> teacherCollection   = GetTeacherNameComboCollection();

            extraMuralAgeGroups.TeacherNameCollection = teacherCollection.Values.ToList();
            if (extraMuralAgeGroups == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId);
            //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId);
            return(View(extraMuralAgeGroups));
        }