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();
|
}
|
}
|
}
|