public ActionResult YeniÜrün(Urunler_TBL model, HttpPostedFileBase File) { string path = Path.Combine("~/Content/Images/" + File.FileName); File.SaveAs(Server.MapPath(path)); model.Urun_Resim = File.FileName.ToString(); db.Urunler_TBL.Add(model); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Guncelle(Urunler_TBL p) { var urun = db.Urunler_TBL.Find(p.Urun_ID); urun.Urun_Adi = p.Urun_Adi; urun.Urun_Ayrinti = p.Urun_Ayrinti; urun.Urun_Kategori = p.Urun_Kategori; urun.Urun_Ucret = p.Urun_Ucret; urun.Urun_Stok = p.Urun_Stok; db.SaveChanges(); return(RedirectToAction("Index")); }