Пример #1
0
 public string RenderNewsletter(NewsletterItem newsletterItem)
 {
     if (newsletterItem.Type == NewsletterType.News)
     {
         return RenderNews(newsletterItem.Content, newsletterItem.ImageUrl, newsletterItem.LinkUrl);
     }
     return "";
 }
Пример #2
0
        private NewsletterItem ConvertToNewsletterItem(int id, string type)
        {
            NewsletterType thisType = GetType(type);
            NewsletterItem nli = new NewsletterItem();
            if (thisType == NewsletterType.News)
            {
                TextPageDoctType news = new DualShockManager().GetNews(id);
                nli.Headline = news.Headline;
                nli.Content = news.Description;
                nli.ImageUrl = news.ImageUpload;
            }

            if(thisType == NewsletterType.Banner)
            {
                nli.ImageUrl = DualShockManager.GetImageUrlFromId(id);
                nli.Type = thisType;
                nli.LinkUrl = "";
            }

            return nli;
        }