Ejemplo n.º 1
0
        private void DelRec_Click(object sender, EventArgs e)
        {
            #region  除指定条件的日志信息

            if (this.CheckCookie())
            {
                string condition = "";

                condition = AdminModeratorLogs.GetDeleteModeratorManageCondition(Request.Form["deleteMode"].ToString(), DNTRequest.GetString("id").ToString(), deleteNum.Text.ToString(), deleteFrom.SelectedDate.ToString());
                if (condition != "")
                {
                    AdminModeratorLogs.DeleteLog(condition);
                    Response.Redirect("forum_moderatormanagelog.aspx");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_moderatormanagelog.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("id") != "")
                //            condition = " [id] IN(" + DNTRequest.GetString("id") + ")";
                //        break;
                //    case "deleteNum":
                //        if (deleteNum.Text != "" && Utils.IsNumeric(deleteNum.Text))
                //            condition = " [id] not in (select top " + deleteNum.Text + " [id] from [" + BaseConfigs.GetTablePrefix + "moderatormanagelog] order by [id] desc)";
                //        break;
                //    case "deleteFrom":
                //        if (deleteFrom.SelectedDate.ToString() != "")
                //            condition = " [postdatetime]<'" + deleteFrom.SelectedDate.ToString() + "'";
                //        break;
                //}
                condition = DatabaseProvider.GetInstance().DelModeratorManageCondition(Request.Form["deleteMode"].ToString(), DNTRequest.GetString("id").ToString(), deleteNum.Text.ToString(), deleteFrom.SelectedDate.ToString());
                if (condition != "")
                {
                    AdminModeratorLogs.DeleteLog(condition);
                    Response.Redirect("forum_moderatormanagelog.aspx");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_moderatormanagelog.aspx';</script>");
                }
            }

            #endregion
        }