public Announcement CreateAnnouncementFromReader(IReaderAdapter reader)
        {
            ThrowIfArgumentNull(reader, nameof(reader));

            var text         = reader.GetString("Text");
            var timestamp    = reader.GetDateTime("Timestamp");
            var category     = reader.GetString("Category");
            var user         = CreateUserFromReader(reader);
            var announcement = Announcement.Create(timestamp, user, text, category);

            return(announcement);
        }
Пример #2
0
 private void AddAnnounceInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         //Announcements.CreateAnnouncement(this.username, this.userid, this.title.Text, this.displayorder.Text.ToInt(0), this.starttime.Text, this.endtime.Text, Request["announcemessage_hidden"]);
         Announcement.Create(userid, username, title.Text, Request["announcemessage_hidden"], Utility.ToDateTime(starttime.Text), Utility.ToDateTime(endtime.Text), Int32.Parse(displayorder.Text));
         XCache.Remove(CacheKeys.FORUM_ANNOUNCEMENT_LIST);
         XCache.Remove(CacheKeys.FORUM_SIMPLIFIED_ANNOUNCEMENT_LIST);
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加公告", "添加公告,标题为:" + this.title.Text);
         base.RegisterStartupScript("PAGE", "window.location.href='global_announcegrid.aspx';");
     }
 }
 public Announcement ToAnnouncement()
 {
     return(Announcement.Create(Text, Category));
 }