The BLL layer is also completed, now to do the interface, add a newly built ASP.NET web application to create a registered page, (the image is like this)
Using
System;
Using
System.collections;
Using
System.componentmodel;
Using
System.data;
Using
System.drawing;
Using
System.Web;
Using
System.Web.SessionState;
Using
System.Web.ui;
Using
System.Web.ui.WebControls;
Using
System.Web.ui.htmlControls;
Using
Guestbook.bll;
Using
Guestbook.dal;
Using
Guestbook.data;
Namespace
Guestbook.Web
{/ ** ////
/// summary> private void InitializeComponent () {this.Button1.Click = new System.EventHandler (this.Button1_Click); this.Load = new System.EventHandler (this.Page_Load);} #endregion private void Button1_Click (object sender, System.EventArgs e) {if (Page.IsValid) {string username = txtUserName.Text; string Email = txtEmail.Text; string pwd = txtPwd.Text; users newUser = new users (); newUser.Name = username; newuser.email = email; newuser.password = pwd; if (! CreateAccount (newuser)) {Valun.ErrorMessage = "User name has been registered, please searce!"; value;}}} Private Bool CreateAccount (user) {Try {UserSbll BLL = New UserSbll (); BLL.USERADD (USER); HTTPCONTEXT.CURRENT.Session ["Accountinfo"] = User; httpContext.current.response.redirect ("default.aspx", true);} Catch {return false;} return true;}}} This process is overall However, in the final test, I met a little problem, that is, start, I can't insert the data, and then I remembered, I didn't copy NHIBERNATE to Web.config, halo, too careless me
Another thing to pay attention is that
<
Configsections
>
<
section
Name
= "NHibernate"
Type
= "System.configuration.namevaluesectionHandler, System, Version = 1.0.3300.0, Culture = Neutral, PublickeyToken = B77A5C561934E089" />
Configsections
>
The above section must be placed under the