예제 #1
0
        //private int GetRecordCount()
        //{
        //    if (this.ViewState["condition"] == null)
        //    {
        //        //return AdminMedalLogs.RecordCount();
        //        return MedalsLog.Meta.Count;
        //    }
        //    return MedalsLog.SearchCount(this.ViewState["condition"].ToString());
        //}

        private void DelRec_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                //string delMedalLogCondition = AdminMedalLogs.GetDelMedalLogCondition(base.Request.Form["deleteMode"].ToString(), Request["id"].ToString(), this.deleteNum.Text.ToString(), this.deleteFrom.SelectedDate.ToString());
                //if (delMedalLogCondition != "")
                //{
                //    AdminMedalLogs.DeleteLog(delMedalLogCondition);
                //    base.Response.Redirect("forum_medalsloggird.aspx");
                //    return;
                //}
                //base.RegisterStartupScript("", "<script>alert('您未选中任何选项或输入参数错误!');window.location.href='forum_medalsloggird.aspx';</script>");

                MedalsLog.Delete(Request["deleteMode"], Request["id"], deleteNum.Text.ToInt(), deleteFrom.SelectedDate);
                base.Response.Redirect("forum_medalsloggird.aspx");
            }
        }
예제 #2
0
        public void BindData()
        {
            var start    = postdatetimeStart.SelectedDate;
            var end      = postdatetimeEnd.SelectedDate;
            var username = Username.Text;
            var rs       = reason.Text;

            this.DataGrid1.AllowCustomPaging = true;
            this.DataGrid1.VirtualItemCount  = MedalsLog.SearchCount(start, end, username, rs, 0, 0);
            this.DataGrid1.DataSource        = MedalsLog.Search(start, end, username, rs, 0, 0);
            //if (this.ViewState["condition"] == null)
            //{
            //    this.DataGrid1.DataSource = MedalsLog.Search(this.DataGrid1.PageSize, this.DataGrid1.CurrentPageIndex + 1);
            //}
            //else
            //{
            //    this.DataGrid1.DataSource = MedalsLog.Search(this.DataGrid1.PageSize, this.DataGrid1.CurrentPageIndex + 1, this.ViewState["condition"].ToString());
            //}
            this.DataGrid1.DataBind();
        }