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

            db.TEACHER_ROUTINE.Remove(tEACHER_ROUTINE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TeacherRoutine_ID,TeacherRoutineDirectory,Teacher_ID,Admin_ID")] TEACHER_ROUTINE tEACHER_ROUTINE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tEACHER_ROUTINE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", tEACHER_ROUTINE.Admin_ID);
     ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", tEACHER_ROUTINE.Teacher_ID);
     return(View(tEACHER_ROUTINE));
 }
コード例 #3
0
        // GET: TEACHER_ROUTINE/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TEACHER_ROUTINE tEACHER_ROUTINE = db.TEACHER_ROUTINE.Find(id);

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

            if (tEACHER_ROUTINE == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", tEACHER_ROUTINE.Admin_ID);
            ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", tEACHER_ROUTINE.Teacher_ID);
            return(View(tEACHER_ROUTINE));
        }
コード例 #5
0
        public ActionResult Create(HttpPostedFileBase file, [Bind(Include = "TeacherRoutine_ID,Teacher_ID,Admin_ID")] TEACHER_ROUTINE tEACHER_ROUTINE)
        {
            if (file.ContentLength > 0)
            {
                string filename = Path.GetFileName(file.FileName);
                string filepath = Path.Combine(Server.MapPath("~/TEACHER ROUTINE"), filename);
                file.SaveAs(filepath);
                tEACHER_ROUTINE.TeacherRoutineDirectory = filename;
            }
            if (ModelState.IsValid)
            {
                db.TEACHER_ROUTINE.Add(tEACHER_ROUTINE);
                db.SaveChanges();
                //   return RedirectToAction("Index");
            }

            ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", tEACHER_ROUTINE.Admin_ID);
            ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", tEACHER_ROUTINE.Teacher_ID);
            ModelState.Clear();
            ViewBag.Message = "successfully created";
            return(View());

            //  return View(tEACHER_ROUTINE);
        }