Example #1
0
        public ActionResult Yorum(int id)
        {
            YorumRep rep   = new YorumRep();
            var      liste = rep.GetAll().Where(x => x.BlogYorum.BlogID == id);

            return(View(liste));
        }
Example #2
0
        public ActionResult YorumYap(Yorum yorum, int id)
        {
            YorumRep rep = new YorumRep();

            yorum.BlogYorumID   = id;
            yorum.YorumYapanId  = User.Identity.GetUserId();
            yorum.EklenmeTarihi = DateTime.Now;
            rep.Insert(yorum);
            return(RedirectToAction("Detail", "Blog", new { @id = id }));
        }
Example #3
0
        // GET: Admin/Admin
        public ActionResult Index()
        {
            TurlerRep rep  = new TurlerRep();
            YorumRep  yRep = new YorumRep();
            BlogRep   bRep = new BlogRep();

            ViewBag.YorumSayisi     = yRep.GetAll().Count.ToString();
            ViewBag.BlogSayisi      = bRep.GetAll().Count.ToString();
            ViewBag.TurSayisi       = rep.GetAll().Count(x => x.TurAdi != "_silindi").ToString();
            ViewBag.KullaniciSayisi = rep.GetAllUser().Count().ToString();
            return(View());
        }
Example #4
0
        public void YorumYap(string yorum, int Haberid)
        {
            Kullanici k            = new Kullanici();
            YorumRep  yrep         = new YorumRep();
            var       yorumyapanID = User.Identity.GetUserId();


            //var kullanici = db.Haberler.Where(x => x..Id == yorumyapanID).FirstOrDefault();
            var haber = db.Haberler.Where(x => x.HaberID == Haberid).FirstOrDefault();

            db.Yorumlar.Add(new Yorum { /*Kullanici = kullanici.Kullanici,*/
                Haberi = haber, YorumTarihi = DateTime.Now, YorumIcerik = yorum
            });
            db.SaveChanges();
            //return Json(false, JsonRequestBehavior.AllowGet);
        }
Example #5
0
        public static string YorumSayisi(int id)
        {
            YorumRep rep = new YorumRep();

            return(rep.GetAll().Count(x => x.BlogYorumID == id).ToString());
        }