M
Mike P
I'm new to writing separate classes for each 'business object' and I'm
wondering if I'm going about it the right way. If I have a property of
a business class that has to be within a range of values specified in a
database table, is this how I would go about it?
public int JobRoleKey
{
get
{
return this.intJobRoleKey;
}
set
{
DataAccessLayer da = new DataAccessLayer();
bool blnValidJobRole = da.ValidateJobRole(value);
if (blnValidJobRole == true)
{
this.intJobRoleKey = value;
}
else
{
throw new JobRoleKeyException();
}
}
}
Many thanks,
Mike
wondering if I'm going about it the right way. If I have a property of
a business class that has to be within a range of values specified in a
database table, is this how I would go about it?
public int JobRoleKey
{
get
{
return this.intJobRoleKey;
}
set
{
DataAccessLayer da = new DataAccessLayer();
bool blnValidJobRole = da.ValidateJobRole(value);
if (blnValidJobRole == true)
{
this.intJobRoleKey = value;
}
else
{
throw new JobRoleKeyException();
}
}
}
Many thanks,
Mike