コード例 #1
0
        //
        // GET: /AddCartoon/Create

        public ActionResult Create()
        {
            var car = new CARTOONS();

            ViewBag.Statuses = db.DIC_CARTOON_STATUSES.ToList();
            return(View(car));
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            CARTOONS car = db.CARTOONS.Find(id);

            db.CARTOONS.Remove(car);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit(CARTOONS car)
 {
     if (ModelState.IsValid)
     {
         db.Entry(car).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(car));
 }
コード例 #4
0
        //
        // GET: /AddCartoon/Details/5

        public ActionResult Details(int id = 0)
        {
            CARTOONS car = db.CARTOONS.Find(id);

            if (car == null)
            {
                return(HttpNotFound());
            }
            return(View(car));
        }
コード例 #5
0
        //
        // GET: /AddCartoon/Delete/5

        public ActionResult Delete(int id)
        {
            CARTOONS car = db.CARTOONS.Find(id);

            if (car == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CarName = car.CR_NAME;
            return(View(car));
        }
コード例 #6
0
        public ActionResult Create(CARTOONS car)
        {
            if (ModelState.IsValid)
            {
                db.CARTOONS.Add(car);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(car));
        }