Ejemplo n.º 1
0
        public ActionResult PostDetails(string html)
        {
            int categoryRowId = 0;

            ArticleModel model = new ArticleModel();
            Category     cat   = new Category();

            using (var db = new DIYFE.EF.DIYFEEntities())
            {
                model.Article = db.Articles.Include("ArticleComments").Where(a => a.URLLink == html + ".html").FirstOrDefault();
            }

            if (model.Article != null)
            {
                cat = DIYFEHelper.GetCatigroy(model.Article.CategoryRowId);
                DIYFELib.Tracking.InsertArticleViewRequest(model.Article.ArticleId);
                // model.Comments = la.ArticleComments(model.Article.ArticleId);

                // model.MostViewed = la.MostViewed(11, 20);
                model.CrumbLinkList   = DIYFEHelper.GenerateCrumbLinks(cat, linkPrefix);
                model.RelatedTreeView = DIYFEHelper.GenerateRelatedTreeView(cat, linkPrefix);

                PageModel.Title       = model.Article.Title;
                PageModel.Description = model.Article.Description;
                PageModel.Author      = model.Article.Author;
                PageModel.Keywords    = model.Article.Keywords;
            }
            else
            {
                //JUST TO GET BY -- REPLACE WITH 404 SOULATION
                model.CrumbLinkList = DIYFEHelper.GenerateCrumbLinks(new Category(), linkPrefix);
                model.Article       = new Article();
                model.Comments      = new List <ArticleComment>();
                //model.RelatedTreeView = DIYFEHelper.GenerateTreeViewThirdLev(model.Article.CategoryRowId, linkPrefix);

                PageModel.Title       = "";
                PageModel.Description = "";
                PageModel.Author      = "";
                PageModel.Keywords    = "";
            }


            // model.Comments = la.ArticleComments(model.Article.ArticleId);

            //model.MostViewed = la.MostViewed(11, 20);
            // model.CrumbLinkList = DIYFEHelper.GenerateCrumbLinks(categoryRowId, linkPrefix);
            model.RelatedTreeView = DIYFEHelper.GenerateTreeViewThirdLev(cat, linkPrefix);

            ////PageModel.Title = model.Article.Title;
            ////PageModel.Description = model.Article.Description;
            ////PageModel.Author = model.Article.Author;
            ////PageModel.Keywords = model.Article.Keywords;

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult ThirdLevCategoryList(string categoryUrl, string subCategoryUrl, string subSubCategoryUrl)
        {
            string url = HttpContext.Request.RawUrl;
            //int catigoryRowId = DIYFEHelper.GetCatigoryRowId(categoryUrl, subCategoryUrl, subSubCategoryUrl);
            Category cat = DIYFEHelper.GetCategory(categoryUrl, subCategoryUrl, subSubCategoryUrl);

            ListAccess   la    = new ListAccess();
            ArticleModel model = new ArticleModel();

            PageModel.ArticleContent.Title       = model.ArticleContent.Title;
            PageModel.ArticleContent.Description = model.ArticleContent.Description;
            PageModel.ArticleContent.Author      = model.ArticleContent.Author;
            PageModel.ArticleContent.Keywords    = model.ArticleContent.Keywords;

            model.MostViewed    = la.MostViewed(11, 20);
            model.CrumbLinkList = DIYFEHelper.GenerateCrumbLinks(cat.CategoryRowId, linkPrefix);
            model.ArticleList   = la.ArticleList(cat.CategoryRowId, 1);

            model.RelatedTreeView = DIYFEHelper.GenerateTreeViewThirdLev(cat.SecondLevCategoryId, linkPrefix);

            return(View(model));
        }