Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tbl_AssignCourse tbl_AssignCourse = db.Tbl_AssignCourse.Find(id);

            db.Tbl_AssignCourse.Remove(tbl_AssignCourse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,TID,LID,SemesterID,CID")] Tbl_AssignCourse tbl_AssignCourse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_AssignCourse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CID        = new SelectList(db.Tbl_Course, "CID", "CourseCode", tbl_AssignCourse.CID);
     ViewBag.LID        = new SelectList(db.Tbl_Level, "LID", "LLevel", tbl_AssignCourse.LID);
     ViewBag.SemesterID = new SelectList(db.Tbl_Semester, "SemesterID", "SemesterName", tbl_AssignCourse.SemesterID);
     ViewBag.TID        = new SelectList(db.Tbl_Teacher, "TID", "Tname", tbl_AssignCourse.TID);
     return(View(tbl_AssignCourse));
 }
Ejemplo n.º 3
0
        // GET: Test/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_AssignCourse tbl_AssignCourse = db.Tbl_AssignCourse.Find(id);

            if (tbl_AssignCourse == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_AssignCourse));
        }
Ejemplo n.º 4
0
        public ActionResult AssignCourse([Bind(Include = "id,TID,LID,SemesterID,CID,LastDate")] Tbl_AssignCourse asCourse)
        {
            if (ModelState.IsValid)
            {
                asCourse.TID = Convert.ToInt32(Session["id"]);
                db.Tbl_AssignCourse.Add(asCourse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CID        = new SelectList(db.Tbl_Course, "CID", "CourseCode", asCourse.CID);
            ViewBag.LID        = new SelectList(db.Tbl_Level, "LID", "LLevel", asCourse.LID);
            ViewBag.SemesterID = new SelectList(db.Tbl_Semester, "SemesterID", "SemesterName", asCourse.SemesterID);
            ViewBag.TID        = new SelectList(db.Tbl_Teacher, "TID", "Tname", asCourse.TID);
            return(View(asCourse));
        }
Ejemplo n.º 5
0
        // GET: Test/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tbl_AssignCourse tbl_AssignCourse = db.Tbl_AssignCourse.Find(id);

            if (tbl_AssignCourse == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CID        = new SelectList(db.Tbl_Course, "CID", "CourseCode", tbl_AssignCourse.CID);
            ViewBag.LID        = new SelectList(db.Tbl_Level, "LID", "LLevel", tbl_AssignCourse.LID);
            ViewBag.SemesterID = new SelectList(db.Tbl_Semester, "SemesterID", "SemesterName", tbl_AssignCourse.SemesterID);
            ViewBag.TID        = new SelectList(db.Tbl_Teacher, "TID", "Tname", tbl_AssignCourse.TID);
            return(View(tbl_AssignCourse));
        }