public ActionResult SiparisDuzenle(int id) { MvcContext db = new MvcContext(); Tedarik t = db.Tedariks.Where(y => y.Tedarik_ID == id).SingleOrDefault(); return(View(t)); }
public ActionResult SiparisSil(int id) { MvcContext db = new MvcContext(); Tedarik ted = db.Tedariks.SingleOrDefault(a => a.Tedarik_ID == id); db.Tedariks.Remove(ted); db.SaveChanges(); return(RedirectToAction("Siparis")); }
public ActionResult SiparisEkle(Tedarik t) { MvcContext db = new MvcContext(); db.Tedariks.Add(t); db.SaveChanges(); ViewBag.Sonuc = t.Tedarik_ID + " Sipariş nolu " + t.Tedarik_Adet + " adet ürün siparişi verildi."; return(View()); }
public ActionResult SiparisDuzenle(Tedarik tedarikGelen) { MvcContext db = new MvcContext(); Tedarik t = db.Tedariks.Where(y => y.Tedarik_ID == tedarikGelen.Tedarik_ID).SingleOrDefault(); //t.Tedarik_ID = tedarikGelen.Tedarik_ID; t.Malzeme_ID = tedarikGelen.Malzeme_ID; t.Tedarik_Adet = tedarikGelen.Tedarik_Adet; t.Siparis_Tarih = tedarikGelen.Siparis_Tarih; t.Fiyat = tedarikGelen.Fiyat; db.SaveChanges(); return(RedirectToAction("Siparis")); }