コード例 #1
0
        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));
        }
コード例 #2
0
 public Ogretmen(OgretimElemani _ogretimElemani, List <Bolum> _bolumler)
 {
     OgretimElemaniId           = _ogretimElemani.OgretimElemaniId;
     OgretimElemaniAdiSoyadi    = _ogretimElemani.OgretimElemaniAdiSoyadi;
     OgretimElemaniKisaltmaa    = _ogretimElemani.OgretimElemaniKisaltmaa;
     OgretimElemanininBolumleri = _ogretimElemani.OgretimElemanininBolumleri;
     TumBolumler = _bolumler;
 }
コード例 #3
0
        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));
        }