public Guid StoreNewNews(string header, string body, string picture, DateTime? validFrom, DateTime? validTo) { using (var db = new IntiDataContext(_connectionString)) { var news = new Ext_News(); news.Header = header; news.Body = body; news.Picture = picture; news.ValidFrom = validFrom; news.ValidTo = validTo; db.Ext_News.InsertOnSubmit(news); LogEvent(news.GUID, news.GetType(), SessionProperties.UserGuid, SessionProperties.ClientInfo, EventType.Create, "New news"); db.SubmitChanges(); return news.GUID; } }
public Guid StoreNewNews(string header, string body, string picture, DateTime?validFrom, DateTime?validTo) { using (var db = new IntiDataContext(_connectionString)) { var news = new Ext_News(); news.Header = header; news.Body = body; news.Picture = picture; news.ValidFrom = validFrom; news.ValidTo = validTo; db.Ext_News.InsertOnSubmit(news); LogEvent(news.GUID, news.GetType(), SessionProperties.UserGuid, SessionProperties.ClientInfo, EventType.Create, "New news"); db.SubmitChanges(); return(news.GUID); } }
partial void DeleteExt_News(Ext_News instance);
partial void UpdateExt_News(Ext_News instance);
partial void InsertExt_News(Ext_News instance);
public NewsDto(Ext_News newsItem) { GUID = newsItem.GUID; Header = newsItem.Header; var body = newsItem.Body.StripTagsRegexCompiled(); Body = body.Length > maxBodyLength ? body.Substring(0, maxBodyLength) + "..." : body; ValidFrom = newsItem.ValidFrom ?? DateTime.Today; }