protected void btnSave_Click(object sender, EventArgs e) { string words = CtrlHelper.GetText(txtWords); if (string.IsNullOrEmpty(words)) { ShowError("抱歉,请输入过滤关键字"); return; } SensitiveWords senWord = FacadeManage.aidePlatformFacade.GetSensitiveWords(words); if (senWord != null) { ShowError("抱歉,输入的过滤关键字已存在"); return; } SensitiveWords word = new SensitiveWords(); word.ForbidWords = words; int result = FacadeManage.aidePlatformFacade.AddSensitiveWords(word); if (result > 0) { ShowInfo("新增成功", "SensitiveWordsList.aspx", 1200); } else { ShowError("抱歉,新增失败"); } }
public static int constructor(IntPtr l) { int result; try { SensitiveWords o = new SensitiveWords(); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static int InitSensitiveWord(IntPtr l) { int result; try { SensitiveWords sensitiveWords = (SensitiveWords)LuaObject.checkSelf(l); string word; LuaObject.checkType(l, 2, out word); sensitiveWords.InitSensitiveWord(word); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static int IsSensitiveWord(IntPtr l) { int result; try { SensitiveWords sensitiveWords = (SensitiveWords)LuaObject.checkSelf(l); string sentence; LuaObject.checkType(l, 2, out sentence); bool b = sensitiveWords.IsSensitiveWord(sentence); LuaObject.pushValue(l, true); LuaObject.pushValue(l, b); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static int ReplaceSensitiveWord(IntPtr l) { int result; try { SensitiveWords sensitiveWords = (SensitiveWords)LuaObject.checkSelf(l); string sentence; LuaObject.checkType(l, 2, out sentence); char replaceChar; LuaObject.checkType(l, 3, out replaceChar); string s = sensitiveWords.ReplaceSensitiveWord(sentence, replaceChar); LuaObject.pushValue(l, true); LuaObject.pushValue(l, s); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
/// <summary> /// 新增关键字 /// </summary> /// <param name="words"></param> /// <returns></returns> public int AddSensitiveWords(SensitiveWords words) { return(aidePlatformData.AddSensitiveWords(words)); }
/// <summary> /// 更新一条数据 /// </summary> public void UpdateSensitiveWords(SensitiveWords entity) { linqHelper.UpdateEntity <SensitiveWords>(entity); }
/// <summary> /// 增加一条数据 /// </summary> public void AddSensitiveWords(SensitiveWords entity) { linqHelper.InsertEntity <SensitiveWords>(entity); }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity"></param> public void UpdateSensitiveWords(SensitiveWords entity) { new SensitiveWordsDAL().UpdateSensitiveWords(entity); }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="entity"></param> public void AddSensitiveWords(SensitiveWords entity) { service.AddSensitiveWords(entity); }