yzh
2022-04-29 4214efaa804bf6f94b28a6db6b099523df9b3252
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using 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();
        }
    }
}