Tuesday, June 26, 2007

[C#.Net] Session Class

public class SessionHelper
{
private const string POLICE_PROFILE = "POLICE_PROFILE";

public static PoliceOfficerDS PoliceProfile
{
get
{
if (HttpContext.Current.Session[POLICE_PROFILE] == null)
{
return new PoliceOfficerDS();
}
else return (PoliceOfficerDS)HttpContext.Current.Session[POLICE_PROFILE];
}
set
{
HttpContext.Current.Session[POLICE_PROFILE] = value;
}
}
}

No comments: