From 91912ad24d477ff24be56f0a22438303a8eae552 Mon Sep 17 00:00:00 2001 From: wzp <2880584989@qq.com> Date: 星期四, 16 九月 2021 16:12:52 +0800 Subject: [PATCH] Merge branch 'Release' of ssh://8.129.227.30:29418/SMGW_NewWeb into Release --- web/Model/PageBase.cs | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/web/Model/PageBase.cs b/web/Model/PageBase.cs new file mode 100644 index 0000000..0bf7c2b --- /dev/null +++ b/web/Model/PageBase.cs @@ -0,0 +1,35 @@ +锘縰sing Common; +using System; +using System.Web; +using System.Web.UI; + +public class PageBase<T> : Page where T : ISessionObject +{ + public PageContext<T> AppContext; + + public override void ProcessRequest(HttpContext context) + { + this.AppContext = new PageContext<T>(context); + if (!this.AppContext.IsValid) + context.Response.Redirect("/error.aspx", true); + base.ProcessRequest(context); + } + + public bool HasRight(string functionID) + { + return this.AppContext.HasRight(functionID); + } + + public void CheckRight(string functionID, FailedOperation failedOperation) + { + try + { + this.AppContext.CheckRight(functionID, failedOperation); + } + catch (Exception ex) + { + this.Response.Write(ex.Message); + this.Response.End(); + } + } +} -- Gitblit v1.9.1