Beispiel #1
0
        public NewsLatestModels displayNewsHome(string language)
        {
            NewsLatestModels result = new NewsLatestModels();
            result.latestNews = this.getLatestNews(language);
            if (result.latestNews != null && result.latestNews.newsImage != null)
            {
                result.latestNews.newsImageContent = Convert.ToBase64String(result.latestNews.newsImage);
            }
            result.nearLatestNews = this.getNearLatestNews(language);

            //if (result != null)
            //{
            //    if (result.latestNews != null)
            //    {
            //        result.latestNews.newsContent = string.Empty;
            //        result.latestNews = TranslateUtils.TranslateNews(result.latestNews, language);
            //    }
            //    for (int i = 0; i < result.nearLatestNews.Count; i++)
            //    {
            //        NewsModels news = result.nearLatestNews[i];
            //        news.newsContent = string.Empty;
            //        news = TranslateUtils.TranslateNews(news, language);
            //    }
            //}

            return result;
        }
Beispiel #2
0
        public NewsLatestModels displayNewsHomeByType(string newsTypeCode, string language)
        {
            NewsLatestModels result = new NewsLatestModels();
            result.latestNews = this.getLatestNewsByType(newsTypeCode, language);
            if (result.latestNews != null && result.latestNews.newsImage != null)
            {
                result.latestNews.newsImageContent = Convert.ToBase64String(result.latestNews.newsImage);
            }
            result.nearLatestNews = this.getNearLatestNewsByType(newsTypeCode, language);

            return result;
        }