public JsonResult BlogSil(int id)
        {
            BlogRep rep = new BlogRep();

            rep.Delete(id);
            return(Json("Kayıt Başarıyla Silindi."));
        }
Beispiel #2
0
        // GET: Blog
        public ActionResult Index()
        {
            BlogRep rep   = new BlogRep();
            var     liste = rep.GetAll().OrderByDescending(x => x.EklenmeTarihi);

            return(View(liste));
        }
Beispiel #3
0
        public ActionResult tags(string id)
        {
            BlogRep rep   = new BlogRep();
            var     liste = rep.GetAll().Where(x => x.Etiket.Contains(id));

            ViewBag.tag = id;
            return(View(liste));
        }
Beispiel #4
0
        public ActionResult Detail(int id)
        {
            BlogRep rep  = new BlogRep();
            var     blog = rep.GetById(id);

            blog.GoruntulenmeSayisi++;
            ViewBag.tags = blog.Etiket;
            rep.Update(blog);
            return(View(blog));
        }
Beispiel #5
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());
        }
Beispiel #6
0
        public GrupModel GetUserById(string id)
        {
            BlogRep   rep   = new BlogRep();
            var       user  = rep.GetAllUser().FirstOrDefault(x => x.Id == id);
            GrupModel model = new GrupModel();

            model.GrupAdi       = user.GrupAdi;
            model.GrupUyeleri   = user.GrupUyeleri;
            model.GrupAciklama  = user.Aciklama;
            model.KurulusTarihi = user.KurulusTarihi;
            return(model);
        }
Beispiel #7
0
        public List <GrupModel> GetAllUsers()
        {
            BlogRep rep = new BlogRep();

            return(rep.GetAllUser().Where(x => x.GrupAdi != "Admin").Select(x => new GrupModel
            {
                GrupAdi = x.GrupAdi,
                GrupUyeleri = x.GrupUyeleri,
                GrupAciklama = x.Aciklama,
                KurulusTarihi = x.KurulusTarihi
            }).ToList());
        }
Beispiel #8
0
        public ActionResult BlogSonuclar()
        {
            BlogRep     rep   = new BlogRep();
            var         blogs = rep.GetAll();
            List <Blog> liste = new List <Blog>();

            foreach (var item in blogs)
            {
                if (item.Etiket.ToLower().Contains(Session["aranacak"].ToString()) ||
                    item.Baslik.ToLower().Contains(Session["aranacak"].ToString()))
                {
                    liste.Add(item);
                }
            }

            return(View(liste));
        }
        // GET: Admin/Blog
        public ActionResult Index()
        {
            BlogRep rep = new BlogRep();

            return(View(rep.GetAll()));
        }
Beispiel #10
0
        public Blog GetBlogById(int id)
        {
            BlogRep rep = new BlogRep();

            return(rep.GetById(id));
        }
Beispiel #11
0
        public List <Blog> GetAllBlogs()
        {
            BlogRep rep = new BlogRep();

            return(rep.GetAll());
        }