public ActionResult Guncelle(Admin guncel) { db.Entry(db.Admins.Find(guncel.AdminID)).CurrentValues.SetValues(guncel); try { db.SaveChanges(); ViewBag.bilgi = true; } catch { ViewBag.bilgi = false; } return(View(guncel)); }
public ActionResult Guncelle(Product guncel) { ViewBag.CategoryList = db.Categories.ToList(); db.Entry(db.Products.Find(guncel.ProductID)).CurrentValues.SetValues(guncel); try { db.SaveChanges(); ViewBag.bilgi = true; } catch { ViewBag.bilgi = false; } return(View(guncel)); }