Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 25th, 2003, 03:23 PM
Registered User
 
Join Date: Sep 2003
Location: Medford, OR, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Enums for accounts???

I can't find the enums that are mentioned on page 153 of the C# version Wrox.WebModules.Accounts.ProcResultCodes.AccountAl ready on file. Its not detailed in the book as far as I can tell. Can somebody point me in the right direction?


  #2 (permalink)  
Old September 25th, 2003, 04:38 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its in the Core Project, in the Enums.cs file.

Is it just me or is everyone getting errors when trying to sign up using an email account already on file.
The following code on the new.aspx.cs page does not seem to be working for me:
if (newUser.Create() == (int)Wrox.WebModules.Accounts.ProcResultCodes.Acco untAlreadyOnFile)
            {
                CreateError.Text = "<br><br>An account with that e-mail address is already on file.<br>";
                CreateError.Visible = true;
            }


Here is the stack trace:
The error occurred in: http://localhost/ThePhile/Modules/Users/new.aspx
Error Message: Exception of type Wrox.WebModules.AppException was thrown.
--------------------------------------------------------------------------------
Stack Trace:
Wrox.WebModules.AppException: Exception of type Wrox.WebModules.AppException was thrown. at Wrox.WebModules.Accounts.Data.User.Create(String emailAddress, Byte[] password, String firstName, String lastName, String address1, String address2, String city, String state, String zipCode, String homePhone, String country) in C:\wrox\ThePhile\Modules\Accounts\ACCOUNTSDATA\Use r.cs:line 75 at Wrox.WebModules.Accounts.Business.User.Create() in C:\wrox\ThePhile\Modules\Accounts\ACCOUNTSBUSINESS \User.cs:line 66 at Wrox.ThePhile.WebModules.Accounts.Web._new.Registe r_Click(Object sender, EventArgs e) in C:\wrox\ThePhile\Modules\Users\new.aspx.cs:line 108 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at System.Web.UI.Page.ProcessRequestMain()

Any Ideas,
Thanks,
d.


  #3 (permalink)  
Old November 4th, 2003, 03:39 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you ever figure this out??

I am having the same problem.

Thanks

-JP

Quote:
quote:Originally posted by developerz
 Its in the Core Project, in the Enums.cs file.

Is it just me or is everyone getting errors when trying to sign up using an email account already on file.
The following code on the new.aspx.cs page does not seem to be working for me:
if (newUser.Create() == (int)Wrox.WebModules.Accounts.ProcResultCodes.Acco untAlreadyOnFile)
            {
                CreateError.Text = "<br><br>An account with that e-mail address is already on file.<br>";
                CreateError.Visible = true;
            }


Here is the stack trace:
The error occurred in: http://localhost/ThePhile/Modules/Users/new.aspx
Error Message: Exception of type Wrox.WebModules.AppException was thrown.
--------------------------------------------------------------------------------
Stack Trace:
Wrox.WebModules.AppException: Exception of type Wrox.WebModules.AppException was thrown. at Wrox.WebModules.Accounts.Data.User.Create(String emailAddress, Byte[] password, String firstName, String lastName, String address1, String address2, String city, String state, String zipCode, String homePhone, String country) in C:\wrox\ThePhile\Modules\Accounts\ACCOUNTSDATA\Use r.cs:line 75 at Wrox.WebModules.Accounts.Business.User.Create() in C:\wrox\ThePhile\Modules\Accounts\ACCOUNTSBUSINESS \User.cs:line 66 at Wrox.ThePhile.WebModules.Accounts.Web._new.Registe r_Click(Object sender, EventArgs e) in C:\wrox\ThePhile\Modules\Users\new.aspx.cs:line 108 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at System.Web.UI.Page.ProcessRequestMain()

Any Ideas,
Thanks,
d.


  #4 (permalink)  
Old November 8th, 2003, 12:07 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

JP I actually did my own mod to get this working.

1st) I changed the sp_Accouns_CreateUser stored procedure, However, don't copy exactly because I have added columns to my User table like Gender


CREATE PROCEDURE sp_Accounts_CreateUser
@EmailAddress varchar(255),
@Password binary(50),
@FirstName varchar(30),
@LastName varchar(50),
@Address1 varchar(80),
@YearofBirth varchar(10),
@City varchar(40),
@State varchar(2),
@ZipCode varchar(10),
@HomePhone varchar(14),
@Country varchar(50),
@Gender varchar(6),
@UserID int output
AS
    DECLARE @NewUserID int

    SELECT @UserID = UserID FROM Accounts_Users WHERE EmailAddress = @EmailAddress

    IF @@RowCount = 0
    BEGIN
    INSERT INTO Accounts_Users(EmailAddress, Password, FirstName, LastName, Address1, YearofBirth,
        City, State, ZipCode, HomePhone, Country, Gender)
    VALUES(@EmailAddress, @Password, @FirstName, @LastName, @Address1, @YearofBirth,
        @City, @State, @ZipCode, @HomePhone, @Country, @Gender)

    SET @NewUserID = @@IDENTITY
    END
    ELSE
    BEGIN
        SET @NewUserID = -1
    END


    Set @UserID = @NewUserID
GO


2nd) In the new.cs file I made the following change

//if (newUser.Create() == (int Wrox.WebModules.Accounts.ProcResultCodes.AccountAl readyOnFile)
                // == -1 is from the stored procedure
                if (newUser.Create() == -1)
                {
                    CreateError.Text = "<br><br>An account with that e-mail address already exists. Please choose a different Email Address.<br>";
                    CreateError.Visible = true;
                }

                else
                {
                    FormsAuthentication.SetAuthCookie( EmailAddress.Text, true );
                    Response.Redirect("congrats.aspx");
                }

3rd)
I added a CreateError asp.net label on the aspx page
---------------------------------------------------------

I think thats it. If not I'm not sure what else I did, but it works for me. Hopefully this helps.

Take care,
d.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enums VS Structs MoDulus Intro Programming 4 January 19th, 2012 10:42 AM
Enums.cs allanhu BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 2nd, 2004 10:37 PM
Accounts RM82 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 April 7th, 2004 09:37 PM
working with enums & properties miguel.ossa C# 2 January 22nd, 2004 04:16 AM



All times are GMT -4. The time now is 07:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.