This in particular:
Wrox.WebModules.Accounts.ProcResultCodes.AccountAlreadyOnFile;
When I try to recreate the code from the book....I get build errors for the
ProcResultCodes [The type or namespace name 'ProcResultCodes' does not
exist in the class or namespace 'CFM.WebModules.Accounts' (are you missing
an assembly reference?)]
Here's the code it is in (from Modules\Accounts\ACCOUNTSDATA\User.cs):
try
{
RunProcedure("sp_Accounts_CreateUser",
parameters, out rowsAffected);
}
catch ( SqlException e )
{
// 2601 is the number returned when the
primary key
// is violated. We know if we're violating
the primary
// key that the e-mail address is already on
file.
// Its cheaper than actually searching for
that address before
// inserting.
if (e.Number == 2601)
{
return
(int)Wrox.WebModules.Accounts.ProcResultCodes.AccountAlreadyOnFile;
}
else
{
throw new AppException("An error
occurred while executing the Accounts_CreateUser stored procedure",
e );
}
}