public ActionResult DeleteConfirmed(int id) { AlinanNot alinanNot = db.AlinanNots.Find(id); db.AlinanNots.Remove(alinanNot); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Yazi,KategoriId")] AlinanNot alinanNot) { if (ModelState.IsValid) { db.Entry(alinanNot).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId); return(View(alinanNot)); }
public ActionResult Create([Bind(Include = "Id,Yazi,KategoriId")] AlinanNot alinanNot) { if (ModelState.IsValid) { db.AlinanNots.Add(alinanNot); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId); return(View(alinanNot)); }
// GET: AlinanNot/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AlinanNot alinanNot = db.AlinanNots.Find(id); if (alinanNot == null) { return(HttpNotFound()); } return(View(alinanNot)); }
// GET: AlinanNot/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AlinanNot alinanNot = db.AlinanNots.Find(id); if (alinanNot == null) { return(HttpNotFound()); } ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId); return(View(alinanNot)); }