public ActionResult Edit([Bind(Include = "SinifID,SinifAdi")] Sinif sinif) { if (ModelState.IsValid) { db.Entry(sinif).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sinif)); }
public ActionResult Edit([Bind(Include = "DersID,DersAdi")] Ders ders) { if (ModelState.IsValid) { db.Entry(ders).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ders)); }
public ActionResult Edit([Bind(Include = "OgretmenID,Adi,Soyadi,Bransi,DersID")] Ogretmen ogretmen) { if (ModelState.IsValid) { db.Entry(ogretmen).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DersID = new SelectList(db.Derses, "DersID", "DersAdi", ogretmen.DersID); return(View(ogretmen)); }
public ActionResult Edit([Bind(Include = "OgrenciID,OkulNo,Adi,Soyadi,SinifID")] Ogrenci ogrenci) { if (ModelState.IsValid) { db.Entry(ogrenci).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SinifID = new SelectList(db.Sinifs, "SinifID", "SinifAdi", ogrenci.SinifID); return(View(ogrenci)); }
public ActionResult Edit([Bind(Include = "ID,OgrenciID,DerID")] OgrenciDers ogrenciDers) { if (ModelState.IsValid) { var liste2 = (from Ders in db.Derses join Ogr in db.Ogretmens on Ders.DersID equals Ogr.DersID where Ogr.OgretmenID == ogrenciDers.DerID select new { DerOgr = Ders.DersAdi + "-" + Ogr.Adi + " " + Ogr.Soyadi }).FirstOrDefault(); ogrenciDers.DerOgr = liste2.DerOgr.ToString(); OgrenciDers ogr = new OgrenciDers(); ogr.ID = ogrenciDers.ID; ogr.OgrenciID = ogrenciDers.OgrenciID; ogr.DerID = ogrenciDers.DerID; ogr.DerOgr = liste2.DerOgr.ToString(); db.Entry(ogrenciDers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } var liste = (from Ders in db.Derses join Ogr in db.Ogretmens on Ders.DersID equals Ogr.DersID select new { DerID = Ogr.OgretmenID, DerOgr = Ders.DersAdi + "-" + Ogr.Adi + " " + Ogr.Soyadi }).ToList(); ViewBag.DersListe = new SelectList(liste.ToList(), "DerID", "DerOgr"); ViewBag.OgrenciID = new SelectList(db.Ogrencis, "OgrenciID", "Adi", ogrenciDers.OgrenciID); return(View(ogrenciDers)); }