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

            db.BranchCourses.Remove(branchCourses);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,BranchesId,CoursesId,StartTime")] BranchCourses branchCourses)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branchCourses).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BranchesId = new SelectList(db.Branches, "Id", "Name", branchCourses.BranchesId);
     ViewBag.CoursesId  = new SelectList(db.Courses, "Id", "Name", branchCourses.CoursesId);
     return(View(branchCourses));
 }
コード例 #3
0
        // GET: BranchCourses/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BranchCourses branchCourses = db.BranchCourses.Find(id);

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

            if (branchCourses == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BranchesId = new SelectList(db.Branches, "Id", "Name", branchCourses.BranchesId);
            ViewBag.CoursesId  = new SelectList(db.Courses, "Id", "Name", branchCourses.CoursesId);
            return(View(branchCourses));
        }