public static void Update(int articleId, string title, string url, string linkName, EditableDivProperty content, DateTime date, ImageProperty image) { var bRep = DependencyResolver.Current.GetService <IBulletinRepository>(); url = HttpUtility.HtmlEncode(url); var bulletin = (NewsBulletin)LoadForArticle(articleId, bRep); bulletin.Title.Value = title; bulletin.Link.Value = linkName; bulletin.Link.Link = url; bulletin.ViewContent.Value = content.Value; bulletin.ViewContent.Type = content.Type; bulletin.ViewContent.CssClass = content.CssClass; bulletin.Date = date; bulletin.Image = image; bulletin.MarkDirty(); bulletin.Save(bRep); }
public static void Create(int articleId, string title, string url, string linkName, EditableDivProperty content, DateTime date, ImageProperty image) { var rep = DependencyResolver.Current.GetService <IBulletinRepository>(); url = HttpUtility.HtmlEncode(url); var bulletin = new NewsBulletin { ArticleId = articleId, Title = new TitleTextBoxProperty { Value = title }, Link = new ReadMoreLinkProperty { Value = linkName, Link = url }, ViewContent = new StandardTextProperty { Value = content.Value, Type = content.Type, CssClass = content.CssClass }, SiteId = 1, Date = date, BulletinType = new BulletinType(rep.FetchType("news")), Image = image }; bulletin.MarkNew(); bulletin.Save(rep); }