private int GetRecordCount()
        {
            #region 得到日志记录数

            if (ViewState["condition"] == null)
            {
                return(AdminPaymentLogs.RecordCount());
            }
            else
            {
                return(AdminPaymentLogs.RecordCount(ViewState["condition"].ToString()));
            }

            #endregion
        }
Exemplo n.º 2
0
        private void SearchLog_Click(object sender, EventArgs e)
        {
            #region  指定查询条件搜索日志信息

            if (this.CheckCookie())
            {
                string sqlstring = AdminPaymentLogs.GetSearchPaymentLogCondition(postdatetimeStart.SelectedDate, postdatetimeEnd.SelectedDate,
                                                                                 Username.Text);

                ViewState["condition"]     = sqlstring;
                DataGrid1.CurrentPageIndex = 0;
                BindData();
            }

            #endregion
        }
        public void BindData()
        {
            #region 数据绑定

            DataGrid1.AllowCustomPaging = true;
            DataGrid1.VirtualItemCount  = GetRecordCount();

            if (ViewState["condition"] == null)
            {
                DataGrid1.DataSource = AdminPaymentLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1);
            }
            else
            {
                DataGrid1.DataSource = AdminPaymentLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1, ViewState["condition"].ToString());
            }
            DataGrid1.DataBind();

            #endregion
        }
Exemplo n.º 4
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 != "")
                {
                    AdminPaymentLogs.DeleteLog(condition);
                    Response.Redirect("forum_paymentloggrid.aspx");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_paymentloggrid.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 + "paymentlog] order by [id] desc)";
                //        break;
                //    case "deleteFrom":
                //        if (deleteFrom.SelectedDate.ToString() != "")
                //            condition = " [buydate]<'" + deleteFrom.SelectedDate.ToString() + "'";
                //        break;
                //}
                condition = DatabaseProvider.GetInstance().DelModeratorManageCondition(Request.Form["deleteMode"].ToString(), DNTRequest.GetString("id").ToString(), deleteNum.Text.ToString(), deleteFrom.SelectedDate.ToString());

                if (condition != "")
                {
                    AdminPaymentLogs.DeleteLog(condition);
                    Response.Redirect("forum_paymentloggrid.aspx");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_paymentloggrid.aspx';</script>");
                }
            }
            #endregion
        }