Пример #1
0
        public ActionResult Create()
        {
            ViewBag.CategoryId = new SelectList(CacheHelper.GetBooksFromCache(), "Id", "Title");
            ViewBag.Yazar      = authorManager.List();
            ViewBag.Kategori   = categoryManager.List();
            ViewBag.Yayınevi   = publisherManager.List();

            return(View(new CreateBookViewModel()));
        }
Пример #2
0
        public ActionResult Detail(string linkUrl)
        {
            if (linkUrl == null)
            {
                //Anasayfaya yönlendiriyoz
                return(RedirectToAction("", ""));
            }
            ViewBag.Title = "Makale | Detay Sayfası";
            // Join yaparak makalemizi yazar özellikleriyle birlikte getiriyoruz.
            ParticalViewModel articleModel = (from article in repoArticle.List()
                                              join author in repoAuthor.List() on article.Author equals author.NameSurname
                                              where article.ArticleUrl == linkUrl
                                              select new ParticalViewModel
            {
                ArticleId = article.Id,
                ArticleUrl = article.ArticleUrl,
                ArticleCategory = article.CategoryName,
                ArticleDate = article.ArticleDate,
                ArticleReading = article.ReadingCount,
                ArticleTags = article.Tags.Split(','),
                Content = article.Content,
                Title = article.Title,
                AuthorName = author.NameSurname,
                AuthorAbout = author.AuthorAbout,
                AuthorImageUrl = author.Image,
                AuthorFacebook = author.FacebookAdress,
                AuthorInstagram = author.InstagramAdress,
                AuthorTwitter = author.TwitterAdress
            }).FirstOrDefault();


            return(View(articleModel));
        }
Пример #3
0
        public ActionResult Detail(string linkUrl)
        {
            if (linkUrl == null)
            {
                return(RedirectToAction("", ""));
            }
            ViewBag.Title = "Makale | Detay Sayfasi";
            ArticleViewModel articleModel = (from article in repoArticle.List()
                                             join author in repoAuthor.List() on article.Author equals author.NameSurname
                                             where article.ArticleUrl == linkUrl
                                             select new ArticleViewModel
            {
                //Article
                ArticleUrl = article.ArticleUrl,
                ArticleCategory = article.CategorName,
                ArticleDate = article.ArticleDate,
                Content = article.Content,
                Title = article.Title,
                ArticleReading = article.ReadingCount,
                ArticleTags = article.Tags.Split(','),
                // Author
                AuthorAbout = author.AuthorAbout,
                AuthorFacebook = author.FacebookAdress,
                AuthorImageUrl = author.Image,
                AuthorInstagram = author.InstagramAdress,
                AuthorName = author.NameSurname,
                AuthorTwitter = author.TwitterAdress,
            }).FirstOrDefault();

            return(View(articleModel));
        }
Пример #4
0
        public ActionResult AuthorArea(string authorName)
        {
            AuthorModel _authorModel = (from author in repoAuthor.List()
                                        where Utils.UrlDuzenleme.UrlCevir(author.NameSurname).ToLower() == authorName
                                        select new AuthorModel
            {
                AuthorName = author.NameSurname,
                AuthorAbout = author.AuthorAbout,
                Image = author.Image,
                Facebook = author.FacebookAdress,
                Twitter = author.TwitterAdress,
                Instagram = author.InstagramAdress
            }).FirstOrDefault();

            return(View(_authorModel));
        }
Пример #5
0
 public ActionResult Index()
 {
     return(View(authorManager.List(x => x.IsActive == true)));
 }