public string RenderNewsletter(NewsletterItem newsletterItem) { if (newsletterItem.Type == NewsletterType.News) { return RenderNews(newsletterItem.Content, newsletterItem.ImageUrl, newsletterItem.LinkUrl); } return ""; }
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; }