Ejemplo n.º 1
0
        public List <tbl_Content> GetContentBySitemapDate(string year, string month, int domainID)
        {
            int y = 0, m = 0;

            int.TryParse(year, out y);
            int.TryParse(month, out m);
            var date = new DateTime(y, m, 1);

            var siteMaps = SitemapRepository.GetByDate(date, domainID).Where(b => b.SM_Live && (b.SM_PublishDate == null || b.SM_PublishDate <= DateTime.Now)).OrderByDescending(b => b.SM_Date);

            if (siteMaps == null || siteMaps.Count() == 0)
            {
                return(null);
            }

            return(siteMaps.Select(s => s.tbl_Content.Where(c => c.C_Approved && !c.C_Deleted).OrderByDescending(c => c.C_ModificationDate).FirstOrDefault()).Where(b => b != null).ToList());
        }
Ejemplo n.º 2
0
 public List <tbl_SiteMap> GetSitemapByDate(DateTime date, int domainID)
 {
     return(SitemapRepository.GetByDate(date, domainID).ToList());
 }