⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 documentcomments.aspx.cs

📁 ASP.NET多线程编程(二),ASP.NET多线程编程(二) .
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Zeroone.FileSystem;

public partial class Admin_DocumentComments : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ReBind();
        }

    }
    void ReBind()
    {
        string path = Path.CheckRepairPath(Request.QueryString["path"]);
        string name = Request.QueryString["name"];
        int pageIndex = Request.QueryString["pageIndex"] == null ? 0 : int.Parse(Request.QueryString["pageIndex"]) - 1;
        int pageSize = 40;
        Document d = DocumentController.GetDocument(path, name);
        this.subject.Text = d.Subject;
        CommentSet cs = d.GetComments(pageIndex, pageSize);
        commentCount.Text = cs.TotalRecords.ToString();
        pager.PageIndex = pageIndex;
        pager.PageSize = pageSize;
        pager.TotalRecords = cs.TotalRecords;
        pager.PageButtonCount = 5;
        pager.UrlPattern = Zeroone.Globals.ApplicationPath + "/admin" + path + "DocumentsList/{0}.aspx";

        rptDocuments.DataSource = cs.Comments;
        rptDocuments.DataBind();

    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        string path = Path.CheckRepairPath(Request.QueryString["path"]);
        Response.Redirect(Zeroone.Globals.ApplicationPath + "/Admin" + path + "DocumentsList.aspx");
    }
    protected void btnManage_Click(object sender, EventArgs e)
    {
        string path = Path.CheckRepairPath(Request.QueryString["path"]);
        string name = Request.QueryString["name"];
        foreach (RepeaterItem item in this.rptDocuments.Items)
        {
            if ((item.ItemType == ListItemType.AlternatingItem) || (item.ItemType == ListItemType.Item))
            {
                System.Web.UI.HtmlControls.HtmlInputCheckBox htmlCB = (HtmlInputCheckBox)item.FindControl("documentCheck");
                if (htmlCB.Checked)
                {
                    string commentPath = CategoryController.SystemCommentPath + path.Substring(1) + name;
                    string commentName = htmlCB.Value;

                    Document d = DocumentController.GetDocument(commentPath, commentName);
                    d.Delete();
                }
            }
        }

        //重新绑定
        ReBind();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -