private void DelRec_Click(object sender, EventArgs e) { #region 除指定条件的日志信息 if (this.CheckCookie()) { string condition = ""; condition = AdminVistLogs.DelVisitLogCondition(Request.Form["deleteMode"].ToString(), DNTRequest.GetString("visitid").ToString(), deleteNum.Text, deleteFrom.SelectedDate.ToString()); if (condition != "") { AdminVistLogs.DeleteLog(condition); Response.Redirect("forum_adminvisitloggrid.aspx"); } else { base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_adminvisitloggrid.aspx';</script>"); } } #endregion }
private void DelRec_Click(object sender, EventArgs e) { #region 除指定条件的日志信息 if (this.CheckCookie()) { string condition = ""; //switch (Request.Form["deleteMode"]) //{ // case "chkall": // if (DNTRequest.GetString("visitid") != "") // condition = " [visitid] IN(" + DNTRequest.GetString("visitid") + ")"; // break; // case "deleteNum": // if (deleteNum.Text != "" && Utils.IsNumeric(deleteNum.Text)) // condition = " [visitid] not in (select top " + deleteNum.Text + " [visitid] from [" + BaseConfigs.GetTablePrefix + "adminvisitlog] order by [visitid] desc)"; // break; // case "deleteFrom": // if (deleteFrom.SelectedDate.ToString() != "") // condition = " [postdatetime]<'" + deleteFrom.SelectedDate.ToString() + "'"; // break; //} condition = DatabaseProvider.GetInstance().DelVisitLogCondition(Request.Form["deleteMode"].ToString(), DNTRequest.GetString("visitid").ToString(), deleteNum.Text, deleteFrom.SelectedDate.ToString()); if (condition != "") { AdminVistLogs.DeleteLog(condition); Response.Redirect("forum_adminvisitloggrid.aspx"); } else { base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_adminvisitloggrid.aspx';</script>"); } } #endregion }