Пример #1
0
 public string GetString4LinkCategory(string key)
 {
     string Value = GetValue(key);
     T_TagServices service = new T_TagServices();
     T_Tag MyTag = service.GetByID(Convert.ToInt32(Value));
     if (MyTag != null) return MyTag.ID + "/" + MyTag.Slug;
     else return Value;
 }
Пример #2
0
        //public ActionResult XemGoiThietKeWeb(int id, string slug)
        //{
        //    T_NewsServices _newServices = new T_NewsServices();
        //    T_News ANews = _newServices.GetByID(id);
        //    return View(ANews);
        //}
        public ActionResult ContentByTag(int id, int? page, int limit = 0)
        {
            int currentPageIndex = page.HasValue ? page.Value - 1 : 0;
            int PageSizeClient;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.PageSizeClient.ToString()), out PageSizeClient);
            PageSizeClient = (PageSizeClient < 1) ? 20 : PageSizeClient;

            IT_TagServices tagServices = new T_TagServices();
            T_Tag ThisTag = tagServices.GetByID(id);
            ViewBag.TagTitle = ThisTag.Title;
            //Get limit itme
            T_NewsServices _newServices = new T_NewsServices();
            IEnumerable<T_News> NewsList = _newServices.GetNewsByTag(id, limit);
            IPagedList<T_News> Model = MvcPaging.PagingExtensions.ToPagedList(NewsList, currentPageIndex, PageSizeClient, NewsList.Count());
            return View("ContentByTag", Model);
        }
Пример #3
0
 public ActionResult Blog(int? page, int? id)
 {
     T_TagServices tagServices = new T_TagServices();
     int BlogId = 1;
     if (id.HasValue)
     {
         BlogId = (int)id;
     }
     else
     {
         Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_Blog_ID.ToString()), out BlogId);
     }
     ViewBag.CateId = BlogId;
     ViewBag.CateTitle = tagServices.GetByID(BlogId).Title;
     int currentPageIndex = page.HasValue ? page.Value - 1 : 0;
     // Get all with paging
     T_NewsServices _newServices = new T_NewsServices();
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(BlogId).OrderByDescending(m => m.CreatedDate);
     int PageSizeClient;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.PageSizeClient.ToString()), out PageSizeClient);
     PageSizeClient = (PageSizeClient < 1) ? 20 : PageSizeClient;
     IPagedList<T_News> Model = MvcPaging.PagingExtensions.ToPagedList(NewsList, currentPageIndex, PageSizeClient, NewsList.Count());
     return View("Blog", Model);
 }
Пример #4
0
 public PartialViewResult GetCategoryMenuFooter(string taxonomy, int limit = 5)
 {
     T_TagServices _tagServices = new T_TagServices();
     IEnumerable<T_Tag> Model = _tagServices.GetByTaxonomy(taxonomy, limit);
     return PartialView(Model);
 }
Пример #5
0
 public ArticleDynamicNodeProvider()
 {
     _newServices = new T_NewsServices();
     _tagServices = new T_TagServices();
 }
Пример #6
0
 public CategoryDynamicNodeProvider()
 {
     _tagServices = new T_TagServices();
 }
Пример #7
0
        public ActionResult ThietKeWeb()
        {
            //Get list mau thiet ke category
            int MauTKId = 1037;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_MauThietKe_ID.ToString()), out MauTKId);
            T_TagServices _tagServices = new T_TagServices();
            IEnumerable<T_Tag> MauThietKeCateList = _tagServices.GetByTaxonomyInCate(Utilities.Constants.TAXONOMY_CATEGORY, MauTKId).OrderBy(m => m.ID);
            ViewBag.MauThietKeCateList = MauThietKeCateList;

            //Get all Mau thiet kê
            T_NewsServices _newServices = new T_NewsServices();
            IEnumerable<MauThietKeViewModel> MauThietKeList = _newServices.GetMauThietKe(MauTKId).OrderBy(m => m.MauThietKe.ID);
            return View(MauThietKeList);
        }
Пример #8
0
 public ActionResult ListInCateModern(int id, int? page)
 {
     T_TagServices tagServices = new T_TagServices();
     ViewBag.CateTitle = tagServices.GetByID(id).Title;
     int currentPageIndex = page.HasValue ? page.Value - 1 : 0;
     // Get all with paging
     T_NewsServices _newServices = new T_NewsServices();
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(id);
     int PageSizeClient;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.PageSizeClient.ToString()), out PageSizeClient);
     PageSizeClient = (PageSizeClient < 1) ? 20 : PageSizeClient;
     IPagedList<T_News> Model = MvcPaging.PagingExtensions.ToPagedList(NewsList, currentPageIndex, PageSizeClient, NewsList.Count());
     return View("ListInCateModern", Model);
 }
Пример #9
0
 public ActionResult GoiThietKeWebsite(int? page)
 {
     T_TagServices tagServices = new T_TagServices();
     int MauTKId = 1039;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_GoiThietKe_ID.ToString()), out MauTKId);
     int currentPageIndex = page.HasValue ? page.Value - 1 : 0;
     // Get all with paging
     T_NewsServices _newServices = new T_NewsServices();
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(MauTKId).OrderBy(m => m.Title);
     int PageSizeClient = 12;
     //Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.PageSizeClient.ToString()), out PageSizeClient);
     //PageSizeClient = (PageSizeClient < 1) ? 20 : PageSizeClient;
     IPagedList<T_News> Model = MvcPaging.PagingExtensions.ToPagedList(NewsList, currentPageIndex, PageSizeClient, NewsList.Count());
     return View(Model);
 }
Пример #10
0
 public PartialViewResult GetOtherMauThietKe(int? exceptId, int limit = 5)
 {
     T_TagServices tagServices = new T_TagServices();
     int GoiTKId = 1037;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_MauThietKe_ID.ToString()), out GoiTKId);
     //ViewBag.GoiTKId = GoiTKId;
     T_NewsServices _newServices = new T_NewsServices();
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(GoiTKId, limit).Where(m => m.ID != exceptId).OrderBy(m => Guid.NewGuid());
     return PartialView(NewsList);
 }
Пример #11
0
 public PartialViewResult GetGoiThietKe(int limit = 6)
 {
     T_TagServices tagServices = new T_TagServices();
     int MauTKId = 1039;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_GoiThietKe_ID.ToString()), out MauTKId);
     //ViewBag.MauTKId = MauTKId;
     T_NewsServices _newServices = new T_NewsServices();
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(MauTKId, limit).OrderBy(m => Guid.NewGuid());
     return PartialView(NewsList);
 }
Пример #12
0
 public PartialViewResult GetBlogCategoryMenu(int limit = 20)
 {
     int BlogId = 1;
     Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_Blog_ID.ToString()), out BlogId);
     T_TagServices _tagServices = new T_TagServices();
     IEnumerable<T_Tag> Model = _tagServices.GetByTaxonomyInCate(Utilities.Constants.TAXONOMY_CATEGORY, BlogId).OrderBy(m => m.ID);
     return PartialView(Model);
 }