private void SaveWord_Click(object sender, EventArgs e) { #region 保存过滤字修改 int row = 0; bool error = false; foreach (object o in DataGrid1.GetKeyIDArray()) { int id = int.Parse(o.ToString()); string find = DataGrid1.GetControlValue(row, "find").Trim(); string replacement = DataGrid1.GetControlValue(row, "replacement").Trim(); if (find == "" || replacement == "") { error = true; continue; } DatabaseProvider.GetInstance().UpdateWord(id, find, replacement); row++; } Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/BanWordList"); Caches.GetBanWordList(); if (error) { base.RegisterStartupScript("PAGE", "alert('某些信息不完整,未能更新!');window.location.href='global_wordgrid.aspx';"); } base.RegisterStartupScript("PAGE", "window.location.href='global_wordgrid.aspx';"); #endregion }