コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: NewsManagement.cs プロジェクト: jacizd/Interntipset
        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);
            }
        }
コード例 #3
0
 partial void DeleteExt_News(Ext_News instance);
コード例 #4
0
 partial void UpdateExt_News(Ext_News instance);
コード例 #5
0
 partial void InsertExt_News(Ext_News instance);
コード例 #6
0
ファイル: News.aspx.cs プロジェクト: supersalad/Interntipset
 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;
 }