コード例 #1
0
ファイル: ProductsController.cs プロジェクト: sumdood31/DIYFE
        //
        // GET: /Products/
        public ActionResult Index()
        {
            PageModel.ArticleContent.Title = "DiyFe Products";
            PageModel.ArticleContent.Description = "List of products dealing with ";
            PageModel.ArticleContent.Author = "Do it yourself for everyone.";
            PageModel.ArticleContent.Keywords = "DIY, DIYFE, do it yourself, homesteading, transition";

            ListAccess la = new ListAccess();
            ArticleModel model = new ArticleModel();
            model.MostViewed = la.MostViewed(11, 20);
            model.CrumbLinkList = new List<CustomHtmlLink>();

            return View(model);
        }
コード例 #2
0
ファイル: ProjectController.cs プロジェクト: sumdood31/DIYFE
        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);
        }
コード例 #3
0
ファイル: ProjectController.cs プロジェクト: sumdood31/DIYFE
        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);
        }
コード例 #4
0
ファイル: ProjectController.cs プロジェクト: sumdood31/DIYFE
        public ActionResult SecondLevCategoryList(string categoryUrl, string subCategoryUrl)
        {
            string url = HttpContext.Request.RawUrl;
            int catigoryId = DIYFEHelper.GetCatigoryRowId(categoryUrl, subCategoryUrl, "");

            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);
            //model.RelatedTreeView = DIYFEHelper.GenerateRelatedTreeView(catigoryId, linkPrefix);
            model.RelatedTreeView = DIYFEHelper.GenerateTreeViewSecondLev(catigoryId, linkPrefix);
            return View(model);
        }
コード例 #5
0
ファイル: PostController.cs プロジェクト: sumdood31/DIYFE
        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);
        }