public ActionResult KitapEkle(Kitap ktp)
        {
            if (ModelState.IsValid)
            {
                ctx.Kitaplar.Add(ktp);


                int sonuc = ctx.SaveChanges();
                if (sonuc > 0)
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(View());
        }
Exemple #2
0
        public ActionResult OkuyanEkle(Okuyan oky)
        {
            if (ModelState.IsValid)
            {
                ctx.Okuyanlar.Add(oky);
            }

            int sonuc = ctx.SaveChanges();

            if (sonuc > 0)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
Exemple #3
0
        public ActionResult Kayit(Kullanici klc)
        {
            if (ModelState.IsValid)
            {
                ctx.Kullanicilar.Add(klc);
            }

            int sonuc = ctx.SaveChanges();

            if (sonuc > 0)
            {
                return(RedirectToAction("Login", "Giris"));
            }
            return(View());
        }
Exemple #4
0
 public ActionResult YazarEkle(Yazar yz)
 {
     ctx.Yazarlar.Add(yz);
     ctx.SaveChanges();
     return(RedirectToAction("Index"));
 }