private void UpdateAnnounceInfo_Click(object sender, EventArgs e) { if (base.CheckCookie()) { //Announcements.UpdateAnnouncement(new AnnouncementInfo //{ // Id = DNTRequest.GetInt("id", 0), // Poster = this.poster.Text.Trim(), // Title = this.title.Text.Trim(), // Displayorder = this.displayorder.Text.ToInt(), // Starttime = this.starttime.Text.ToDateTime(), // Endtime = this.endtime.Text.ToDateTime(), // Message = Request["announcemessage_hidden"].Trim() //}); var entity = Announcement.FindByID(DNTRequest.GetInt("id", 0)); entity.Poster = poster.Text.Trim(); entity.Title = title.Text.Trim(); entity.Message = Request["announcemessage_hidden"].Trim(); entity.StartTime = this.starttime.Text.ToDateTime(); entity.EndTime = this.endtime.Text.ToDateTime(); entity.DisplayOrder = Int32.Parse(displayorder.Text); entity.Save(); 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';"); } }
private void DeleteAnnounce_Click(object sender, EventArgs e) { if (base.CheckCookie()) { //Announcements.DeleteAnnouncements(Request["id"]); var entity = Announcement.FindByID(Int32.Parse(Request["id"])); if (entity != null) { entity.Delete(); } 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 void LoadAnnounceInf(int id) { var announcement = Announcement.FindByID(id); if (announcement == null) { return; } this.displayorder.Text = announcement.DisplayOrder.ToString(); this.title.Text = announcement.Title; this.poster.Text = announcement.Poster; this.starttime.Text = Utils.GetStandardDateTime(announcement.StartTime.ToString()); this.endtime.Text = Utils.GetStandardDateTime(announcement.EndTime.ToString()); this.announce.Text = announcement.Message; }
private void DelRec_Click(object sender, EventArgs e) { if (base.CheckCookie()) { if (Request["id"] != "") { //Announcements.DeleteAnnouncements(Request["id"]); var entity = Announcement.FindByID(Int32.Parse(Request["id"])); if (entity != null) { entity.Delete(); } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除公告", "删除公告,公告ID为: " + Request["id"]); base.Response.Redirect("global_announcegrid.aspx"); return; } base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='global_announcegrid.aspx';</script>"); } }