public async Task <IActionResult> Edit(int id, [Bind("OgretimElemaniId,OgretimElemaniAdiSoyadi,OgretimElemaniKisaltmaa")] OgretimElemani ogretimElemani) { if (id != ogretimElemani.OgretimElemaniId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ogretimElemani); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OgretimElemaniExists(ogretimElemani.OgretimElemaniId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ogretimElemani)); }
public Ogretmen(OgretimElemani _ogretimElemani, List <Bolum> _bolumler) { OgretimElemaniId = _ogretimElemani.OgretimElemaniId; OgretimElemaniAdiSoyadi = _ogretimElemani.OgretimElemaniAdiSoyadi; OgretimElemaniKisaltmaa = _ogretimElemani.OgretimElemaniKisaltmaa; OgretimElemanininBolumleri = _ogretimElemani.OgretimElemanininBolumleri; TumBolumler = _bolumler; }
public async Task <IActionResult> Create([Bind("OgretimElemaniId,OgretimElemaniAdiSoyadi,OgretimElemaniKisaltmaa")] OgretimElemani ogretimElemani) { if (ModelState.IsValid) { _context.Add(ogretimElemani); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ogretimElemani)); }