示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CAR_DETAIL cAR_DETAIL = db.CAR_DETAIL.Find(id);

            db.CAR_DETAIL.Remove(cAR_DETAIL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "ID,CARNAME,CARMODEL,CARGEAR,ENGINE_CC,INSTRUCTOR_ID")] CAR_DETAIL cAR_DETAIL)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cAR_DETAIL).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.INSTRUCTOR_ID = new SelectList(db.INSTRUCTORs, "ID", "FULLNAME", cAR_DETAIL.INSTRUCTOR_ID);
     return(View(cAR_DETAIL));
 }
示例#3
0
        // GET: cardetail/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CAR_DETAIL cAR_DETAIL = db.CAR_DETAIL.Find(id);

            if (cAR_DETAIL == null)
            {
                return(HttpNotFound());
            }
            return(View(cAR_DETAIL));
        }
示例#4
0
        // GET: cardetail/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CAR_DETAIL cAR_DETAIL = db.CAR_DETAIL.Find(id);

            if (cAR_DETAIL == null)
            {
                return(HttpNotFound());
            }
            ViewBag.INSTRUCTOR_ID = new SelectList(db.INSTRUCTORs, "ID", "FULLNAME", cAR_DETAIL.INSTRUCTOR_ID);
            return(View(cAR_DETAIL));
        }