public ActionResult Update(Guid id) { RestorantKategori guncelrk = rks.GetbyID(id); ViewBag.RestaurantID = new SelectList(rs.GetActive(), "ID", "Name", guncelrk.RestaurantID); ViewBag.CategoryID = new SelectList(cs.GetActive(), "ID", "Name", guncelrk.CategoryID); return(View(rks.GetbyID(id))); }
public ActionResult Update(RestorantKategori item) { ViewBag.RestaurantID = new SelectList(rs.GetActive(), "ID", "Name", item.RestaurantID); ViewBag.CategoryID = new SelectList(cs.GetActive(), "ID", "Name", item.CategoryID); if (ModelState.IsValid) { bool sonuc = rks.Update(item); if (sonuc) { return(RedirectToAction("Index")); } else { ViewBag.Mesaj = "Kategori Ekleme işlemi Sirasinda bir hata olustu.Lütfen daha sonra tekrar deneyin."; } } else { ViewBag.Mesaj = "Girmiş oldugunuz bilgiler hatali formattta veya eksiktir.Lütfen girmeye çaliştiğiniz verileri kontrol edin."; } return(View()); }