예제 #1
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);
 }
예제 #2
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);
 }
예제 #3
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);
 }
예제 #4
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);
 }
예제 #5
0
        public PartialViewResult GetNewsInCategoryModern(int CateId, int Number = 8, int column = 4)
        {
            ViewBag.Column = column;

            T_NewsServices _newServices = new T_NewsServices();
            IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(CateId, Number);
            return PartialView("GetNewsInCategoryModern", NewsList);
        }
예제 #6
0
 public PartialViewResult GetNewsInCategory(int CateId, int Number = 5)
 {
     T_NewsServices _newServices = new T_NewsServices();
     //Get limit itme
     IEnumerable<T_News> NewsList = _newServices.GetByTaxonomy(CateId, Number);
     return PartialView("GetNewsInCategory", NewsList);
 }
예제 #7
0
        public PartialViewResult GetListDichVu(int? exceptId, int limit = 5)
        {
            int DichVuId = 1031;
            Int32.TryParse(TNVTH.Web.GlobalConfig.Instance.GetValue(TNVTH.Web.Utilities.Config.Conf_DichVu_ID.ToString()), out DichVuId);

            //Get all Dịch vụ
            T_NewsServices _newServices = new T_NewsServices();
            IEnumerable<T_News> DichVuList = _newServices.GetByTaxonomy(DichVuId, limit).Where(m => m.ID != exceptId).OrderBy(m => Guid.NewGuid());
            return PartialView(DichVuList);
        }
예제 #8
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);
 }