Hi all,
Can I have a class that contains a IsDirector Method & IsDirector property.
The method populates the property.
I have tried the code below..but get a 'definition for IsDirector' already
exists.
Cheers,
Adam
using System;
using System.Web;
public class Security
{
//private variable declarations
private Boolean _IsDirector;
private System.Web.SessionState.HttpSessionState Session;
public Security()
{
//initialise class properties
_IsDirector = IsDirector();
}
public Boolean IsDirector()
{
//determine if a user session is exists
if(null != System.Web.HttpContext.Current.Session)
{
//retrieve session object from page
Session = System.Web.HttpContext.Current.Session;
//determine if logged in user belongs to the directors user group
if ((int)Session("GroupID") = 1)
{
//return boolean indicating user is a director
return true;
}
}
//return boolean indicate user is not a director
return false;
}
public Boolean IsDirector
{
get
{
return _IsDirector;
}
}
}