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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }