protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 获取页面参数 ViewState["Report"] = Request.QueryString["Report"] != null ? new Guid(Request.QueryString["Report"]) : Guid.Empty; ViewState["LoadCache"] = Request.QueryString["LoadCache"] != null ? Request.QueryString["LoadCache"] != "false" : true; #endregion if ((Guid)ViewState["Report"] == Guid.Empty) { Response.Redirect("Rpt_ReportList.aspx"); } #region 判断有无浏览权限 //Rpt_Report rpt = new Rpt_ReportBLL((Guid)ViewState["Report"]).Model; //if (rpt == null) Response.Redirect("Rpt_ReportList.aspx"); //IList<Rpt_FolderRight> rights = Rpt_FolderRightBLL.GetAssignedRightByUser(Session["UserName"].ToString()).Where(p => p.Folder == rpt.Folder).ToList(); //if (rights.Count == 0) //{ // MessageBox.ShowAndRedirect(this, "对不起,您没有权限浏览该报表", "Rpt_ReportList.aspx"); // return; //} #endregion //增加浏览记录 Rpt_ReportBLL.AddViewTimes(new Guid(ViewState["Report"].ToString()), (int)Session["UserID"]); bt_Refresh_Click(null, null); } }