/// <summary> /// 新闻公告 /// </summary> /// <returns></returns> public static List <AnnNews> ListNews() { AnnNews condition = new AnnNews(); AnnNews value = new AnnNews(); return(TableOperate <AnnNews> .Select(value, condition, 5, "order by iszd,ishot asc,id desc")); }
protected void Page_Load(object sender, EventArgs e) { AnnNews condition = new AnnNews(); AnnNews value = new AnnNews(); m_tableManageList = TableOperate <AnnNews> .Select(value, condition, 0, "ORDER BY IsZD DESC, IsHot DESC, ID DESC"); DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.Request["iD"])) { int _iD = Convert.ToInt32(this.Request["iD"]); AnnNews condition = new AnnNews(); condition.ID = _iD; news = TableOperate <AnnNews> .GetRowData(condition); } DataBind(); }
public static string GetTopNews() { AnnNews condition = new AnnNews(); AnnNews value = new AnnNews(); List <AnnNews> list = TableOperate <AnnNews> .Select(value, condition, 1, "order by iszd,ishot asc,id desc"); if (list.Count > 0) { return(SysConfig.GetStr1(list[0].Title, 20)); } return("暂无公告"); }
protected void Page_Load(object sender, EventArgs e) { AnnNews condition = new AnnNews(); AnnNews value = new AnnNews(); string title = GetstringKey("name"); t = GetstringKey("t"); if (t != "") { condition.AddID = AdminMethod.AdminID; } if (title != "") { condition.Title = "%" + title + "%"; condition.AddAttach("Title", "like"); } m_tableManageList = TableOperate <AnnNews> .SelectByPage(value, condition, "ORDER BY IsZD DESC, IsHot DESC, ID DESC", PageSize, PageIndex, ref Count); DataBind(); name.Value = title; }
protected void AddLog(string ids) { AnnNews condition = new AnnNews(); AnnNews value = new AnnNews(); condition.AddConditon(" and id in(" + ids + ")"); List <AnnNews> list = TableOperate <AnnNews> .Select(value, condition); if (list.Count > 0) { string deltitle = ""; for (int i = 0; i < list.Count; i++) { deltitle += list[i].Title + ","; } deltitle = deltitle.TrimEnd(','); if (deltitle != "") { string logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "删除了【" + deltitle + "】的公告"; Lognet.AddLogin(logbrief); } } }
protected void Page_Load(object sender, EventArgs e) { string action = GetstringKey("action"); if (action != "save") { if (!string.IsNullOrEmpty(this.Request["iD"])) { int _iD = Convert.ToInt32(this.Request["iD"]); AnnNews condition = new AnnNews(); condition.ID = _iD; news = TableOperate <AnnNews> .GetRowData(condition); iD.Value = Convert.ToString(news.ID); } DataBind(); } else { Result result = new Result(); string logbrief = ""; AnnNews newChannelNews = new AnnNews(); newChannelNews.ID = 0; newChannelNews.IsHot = false; newChannelNews.IsZD = false; newChannelNews.AutoForm(this.Page); string Title = newChannelNews.Title; int _iD; if (!string.IsNullOrEmpty(this.Request["iD"])) { _iD = Convert.ToInt32(this.Request["iD"]); TableOperate <AnnNews> .Update(newChannelNews); result.msg = "编辑成功,等待返回列表"; logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的公告"; } else { newChannelNews.AddTime = DateTime.Now; newChannelNews.AddID = AdminMethod.AdminID; newChannelNews.AddName = AdminMethod.AdminFullName; _iD = TableOperate <AnnNews> .InsertReturnID(newChannelNews); result.msg = "添加成功,等待返回列表"; logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "添加了为【" + Title + "】的公告"; } if (_iD > 0) { result.isOk = true; Lognet.AddLogin(logbrief); } else { result.msg = "操作失败"; } Response.ContentType = "text/json"; Response.Write(new JavaScriptSerializer().Serialize(result)); Response.End(); } DataBind(); }