以下是引用片段:
private void LinkButton2_Click(object sender, System.EventArgs e) { //判断注册信息是否正确 if(this.TextBox1.Text.Trim()=="" || this.Textbox8.Text=="" ) { this.TErr.InnerHtml="用户名称或付款帐号不能为空"; return; } if(this.Textbox5.Text.Trim()!=this.Textbox6.Text.Trim() ) { this.TErr.InnerHtml="密码不一致!"; return; } DataTable tmpda=new DataTable(); tmpda=DataControl.GetDataTable("select * from YHXX where Kh='"+ this.TextBox1.Text.Trim() +"'",Session["Dbase"].ToString()); if(tmpda.Rows.Count>0 ) { this.TErr.InnerHtml="客户名称重复!"; return; } //添加注册的用户信息到数据库中 DataControl.ExecSql("insert into YHXX(kh,mm,lxdz,dh,sr,Email,IDCount) values('"+ this.TextBox1.Text.Trim() +"','"+ this.Textbox5.Text.Trim() +"','"+ this.Textbox2.Text.Trim() +"','"+ this.TextBox3.Text.Trim() +"','"+ this.TextBox4.Text.Trim() +"','"+ this.Textbox7.Text.Trim() +"','"+ this.Textbox8.Text.Trim() +"')",Session["Dbase"].ToString()); Session["User"]=this.TextBox1.Text.Trim(); Response.Redirect("MainOut.aspx"); }
private void LinkButton1_Click(object sender, System.EventArgs e) { //跳转页面 Response.R("MainIn.aspx"); } }
|