示例#1
0
        public ActionResult KitapEkle(Kitap ktp)
        {
            if (ModelState.IsValid)
            {
                ctx.Kitaplar.Add(ktp);


                int sonuc = ctx.SaveChanges();
                if (sonuc > 0)
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(View());
        }
示例#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());
        }
示例#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());
        }
示例#4
0
 public ActionResult YazarEkle(Yazar yz)
 {
     ctx.Yazarlar.Add(yz);
     ctx.SaveChanges();
     return(RedirectToAction("Index"));
 }