Exemplo n.º 1
0
        public ActionResult Create(Film film)
        {
            if (ModelState.IsValid)
            {
                film.bDelete = false;
                db.Films.Add(film);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.Loai = new SelectList(db.Loais, "ID", "TenLoai", film.Loai);
            return View(film);
        }
Exemplo n.º 2
0
 public ActionResult Edit(Film film)
 {
     if (ModelState.IsValid)
     {
         film.bDelete = false;
         db.Entry(film).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.Loai = new SelectList(db.Loais, "ID", "TenLoai", film.Loai);
     return View(film);
 }