Ejemplo n.º 1
0
        public ActionResult FirstLevCategoryList(string categoryUrl, string subCategoryUrl, string subSubCategoryUrl, int?page)
        {
            ProjectListModel model = new ProjectListModel();

            //model.MostViewed = la.MostViewed(11, 20);
            //model.CrumbLinkList = new List<CustomHtmlLink>();
            //AppStatic.Categories.Where(c => c.CategoryUrl == categoryUrl);
            PageModel.Title       = "";
            PageModel.Description = "";
            PageModel.Author      = "";
            PageModel.Keywords    = "";

            string url = HttpContext.Request.RawUrl;
            //int categoryRowId = DIYFEHelper.GetCatigoryRowId(categoryUrl, "", "");
            Category cat = DIYFEHelper.GetCatigory(categoryUrl, subCategoryUrl, subSubCategoryUrl);

            model.CrumbLinkList   = DIYFEHelper.GenerateCrumbLinks(cat, linkPrefix);
            model.RelatedTreeView = DIYFEHelper.GenerateRelatedTreeView(cat, linkPrefix);

            using (var db = new DIYFE.EF.DIYFEEntities())
            {
                //BASED ON CAT
                model.ArticleList  = db.Articles.Include("ArticleComments").Where(a => a.ArticleTypeId == 1 && a.Category.CategoryId == cat.CategoryId).OrderBy(a => a.CreatedDate);
                model.PagedArticle = model.ArticleList.Concat(db.Articles.Include("ArticleComments").Include("ArticleStatus.StatusType").Where(a => a.ArticleTypeId == 2 && a.Category.CategoryId == cat.CategoryId).OrderBy(a => a.ArticleStatus.Any(aStat => aStat.StatusId == 1))).OrderByDescending(a => a.CreatedDate).ToPagedList(page ?? 1, pageSize);

                //CHECK PAGING
                //model.ArticleList = db.Articles.Include("ArticleComments").Where(a => a.ArticleTypeId == 1);
                //model.PagedArticle = model.ArticleList.Concat(db.Articles.Include("ArticleComments").Include("ArticleStatus.StatusType").Where(a => a.ArticleTypeId == 2)).OrderBy(a => a.CreatedDate).ToPagedList(page ?? 1, pageSize);
            }
            //model.PagedArticle = model.ArticleList.ToPagedList(page ?? 1, pageSize);
            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult PostDetails(string html)
        {
            int _categoryId = 0;

            ListAccess la = new ListAccess();

            ArticleModel model = new ArticleModel();

            model.ArticleContent.LoadArticle(html);
            model.Comments = la.ArticleComments(model.ArticleContent.ArticleId);

            if (model.ArticleContent.CategoryId > 0)
            {
                _categoryId = model.ArticleContent.CategoryId;
            }
            else if (model.ArticleContent.SecondLevCategoryId > 0)
            {
                _categoryId = model.ArticleContent.SecondLevCategoryId;
            }
            else
            {
                _categoryId = model.ArticleContent.ThirdLevCategoryId;
            }

            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(_categoryId, 20);

            model.RelatedTreeView = DIYFEHelper.GenerateTreeViewSecondLev(_categoryId, linkPrefix);

            return(View(model));
        }
Ejemplo n.º 3
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.º 4
0
        public ActionResult ThirdLevCategoryList(string categoryUrl, string subCategoryUrl, string subSubCategoryUrl)
        {
            string url        = HttpContext.Request.RawUrl;
            int    catigoryId = DIYFEHelper.GetCatigoryRowId(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(catigoryId, linkPrefix);
            model.ArticleList   = la.ArticleList(catigoryId, 1);

            return(View(model));
        }
Ejemplo n.º 5
0
        public ActionResult FirstLevCategoryList(string categoryUrl)
        {
            ListAccess   la    = new ListAccess();
            ArticleModel model = new ArticleModel();

            model.MostViewed = la.MostViewed(11, 20);
            //model.CrumbLinkList = new List<CustomHtmlLink>();
            //AppStatic.Categories.Where(c => c.CategoryUrl == categoryUrl);
            PageModel.ArticleContent.Title       = model.ArticleContent.Title;
            PageModel.ArticleContent.Description = model.ArticleContent.Description;
            PageModel.ArticleContent.Author      = model.ArticleContent.Author;
            PageModel.ArticleContent.Keywords    = model.ArticleContent.Keywords;

            string url        = HttpContext.Request.RawUrl;
            int    catigoryId = DIYFEHelper.GetCatigoryRowId(categoryUrl, "", "");

            model.CrumbLinkList = DIYFEHelper.GenerateCrumbLinks(catigoryId, linkPrefix);
            model.ArticleList   = la.ArticleList(catigoryId, 1);
            // model.RelatedTreeView = DIYFEHelper.GenerateRelatedTreeView(catigoryId, linkPrefix);

            return(View(model));
        }
Ejemplo n.º 6
0
        public ActionResult Index()
        {
            ArticleModel model = new ArticleModel();

            model.ArticleContent.LoadArticle(5);

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

            ListAccess la = new ListAccess();

            model.MostViewed = la.MostViewed(11, 20);

            string url        = HttpContext.Request.RawUrl;
            int    catigoryId = DIYFEHelper.GetCatigoryRowId(url);

            model.CrumbLinkList = DIYFEHelper.GenerateCrumbLinks(catigoryId, linkPrefix);
            //model.ArticleList = la.ArticleList(catigoryId, 1);

            return(View(model));
        }