public ActionResult Edit(Int32 id) { anm_News anm_news = db.anm_News.Single(a => a.idnews == id); ViewBag.idcategory = new SelectList(db.anm_Categories, "idcategory", "category", anm_news.idcategory); return(View(anm_news)); }
public ActionResult DeleteConfirmed(int id) { anm_News anm_news = db.anm_News.Single(a => a.idnews == id); db.anm_News.DeleteObject(anm_news); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(anm_News anm_news) { if (ModelState.IsValid) { db.anm_News.Attach(anm_news); db.ObjectStateManager.ChangeObjectState(anm_news, EntityState.Modified); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idcategory = new SelectList(db.anm_Categories, "idcategory", "category", anm_news.idcategory); return(View(anm_news)); }
public ActionResult Create(anm_News anm_news) { if (ModelState.IsValid) { db.anm_News.AddObject(anm_news); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idcategory = new SelectList(db.anm_Categories, "idcategory", "category", anm_news.idcategory); return(View(anm_news)); }
// // GET: /News/Delete/5 public ActionResult Delete(int id) { anm_News anm_news = db.anm_News.Single(a => a.idnews == id); return(View(anm_news)); }
// // GET: /News/Details/5 public ViewResult Details(int id) { anm_News anm_news = db.anm_News.Single(a => a.idnews == id); return(View(anm_news)); }