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

            db.classIV_courses.Remove(classIV_courses);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "cous_id,cous_name")] classIV_courses classIV_courses)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classIV_courses).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(classIV_courses));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "cous_id,cous_name")] classIV_courses classIV_courses)
        {
            if (ModelState.IsValid)
            {
                db.classIV_courses.Add(classIV_courses);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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