public ActionResult Guncelle(int id) { var model = new ContentFormView() { Kullanicilar = db.Kullanici.ToList(), Content = db.Content.Find(id) }; return(View("TodaysContentForm", model)); }
public ActionResult Yeni() { var model = new ContentFormView() { Content = new Models.EntityFramework.Content(), Kullanicilar = db.Kullanici.ToList() }; return(View("ContentForm", model)); }
public ActionResult Kaydet(Content content) { if (!ModelState.IsValid) { var model = new ContentFormView() { Kullanicilar = db.Kullanici.ToList(), Content = content }; return(View("TodaysContentForm", model)); } if (content.Id == 0) { db.Content.Add(content); } else { db.Entry(content).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); return(RedirectToAction("Index")); }