/// <summary> /// 获取关键词库 /// </summary> /// <returns></returns> public static List <SpeechKeyWord> GetKey() { SpeechKeyWord condition = new SpeechKeyWord(); SpeechKeyWord value = new SpeechKeyWord(); condition.ExhibitionID = AdminMethod.ExhibitionID; List <SpeechKeyWord> list = TableOperate <SpeechKeyWord> .Select(value, condition); return(list); }
protected void Page_Load(object sender, EventArgs e) { SpeechKeyWord condition = new SpeechKeyWord(); SpeechKeyWord value = new SpeechKeyWord(); string title = GetstringKey("name"); if (title != "") { condition.KeyWords = "%" + title + "%"; condition.AddAttach("KeyWords", "like"); } condition.ExhibitionID = AdminMethod.ExhibitionID; m_tableManageList = TableOperate <SpeechKeyWord> .SelectByPage(value, condition, "order by id desc", PageSize, PageIndex, ref Count); DataBind(); name.Value = title; }
protected void AddLog(string ids) { SpeechKeyWord condition = new SpeechKeyWord(); SpeechKeyWord value = new SpeechKeyWord(); condition.AddConditon(" and id in(" + ids + ")"); List <SpeechKeyWord> list = TableOperate <SpeechKeyWord> .Select(value, condition); if (list.Count > 0) { string deltitle = ""; for (int i = 0; i < list.Count; i++) { deltitle += list[i].KeyWords + ","; } 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"]); SpeechKeyWord condition = new SpeechKeyWord(); condition.ID = _iD; news = TableOperate <SpeechKeyWord> .GetRowData(condition); iD.Value = Convert.ToString(news.ID); } DataBind(); } else { Result result = new Result(); string logbrief = ""; SpeechKeyWord newChannelNews = new SpeechKeyWord(); newChannelNews.ID = 0; newChannelNews.AutoForm(this.Page); string Title = newChannelNews.KeyWords; int _iD; if (!string.IsNullOrEmpty(this.Request["iD"])) { _iD = Convert.ToInt32(this.Request["iD"]); TableOperate <SpeechKeyWord> .Update(newChannelNews); result.msg = "编辑成功,等待返回列表"; logbrief = "管理员:【" + AdminMethod.AdminFullName + "】在" + DateTime.Now.GetDateTimeFormats('f')[0].ToString() + "编辑了为【" + Title + "】的关键词"; } else { newChannelNews.AddTime = DateTime.Now; newChannelNews.AddID = AdminMethod.AdminID; newChannelNews.ExhibitionID = AdminMethod.ExhibitionID; _iD = TableOperate <SpeechKeyWord> .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(); }