public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Teacher_Course_Allocation teacher_Course_Allocation = await db.Teacher_Course_Allocation.FindAsync(id);

            db.Teacher_Course_Allocation.Remove(teacher_Course_Allocation);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        // GET: Teacher_Course_Allocation/Details/5
        public ActionResult Details(int teacherID, int classID, String courseCode)
        {
            Teacher_Course_Allocation teacher_Course_Allocation = db.Teacher_Course_Allocation.Where(o => o.teacherID == teacherID && o.classID == classID && o.courseCode == courseCode).First();

            if (teacher_Course_Allocation == null)
            {
                return(HttpNotFound());
            }
            return(View(teacher_Course_Allocation));
        }
        // GET: Teacher_Course_Allocation/Edit/5
        public ActionResult Edit(int teacherID, int classID, String courseCode)
        {
            Teacher_Course_Allocation teacher_Course_Allocation = db.Teacher_Course_Allocation.Where(o => o.teacherID == teacherID && o.classID == classID && o.courseCode == courseCode).First();

            if (teacher_Course_Allocation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.classID    = new SelectList(db.Classes, "classID", "name", teacher_Course_Allocation.classID);
            ViewBag.courseCode = new SelectList(db.Subjects, "courseCode", "name", teacher_Course_Allocation.courseCode);
            ViewBag.teacherID  = new SelectList(db.Teachers, "teacherID", "name", teacher_Course_Allocation.teacherID);
            return(View(teacher_Course_Allocation));
        }
        public async Task <ActionResult> Edit([Bind(Include = "teacherID,classID,courseCode,isCurrent")] Teacher_Course_Allocation teacher_Course_Allocation)
        {
            if (ModelState.IsValid)
            {
                db.Entry(teacher_Course_Allocation).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.classID    = new SelectList(db.Classes, "classID", "name", teacher_Course_Allocation.classID);
            ViewBag.courseCode = new SelectList(db.Subjects, "courseCode", "name", teacher_Course_Allocation.courseCode);
            ViewBag.teacherID  = new SelectList(db.Teachers, "teacherID", "name", teacher_Course_Allocation.teacherID);
            return(View(teacher_Course_Allocation));
        }
        // GET: Teacher_Course_Allocation/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Teacher_Course_Allocation teacher_Course_Allocation = await db.Teacher_Course_Allocation.FindAsync(id);

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