以下是引用片段:
核心代码如下: protected void btnZC_Click(object sender, EventArgs e) { ////判断信息是否正确 if (this.txtUName.Text.Trim() == "") { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "ert('用户名不能为空!');"); return; } if (this.txtPwd.Text.Trim() != this.txtQRPwd.Text.Trim()) { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "alt('密码不一致!');"); return; } if (DataBase.Get_Table("select * from 会员信息 where 会员名='" + txtUName.Text.Trim() + "'").Rows.Count > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "ert('会员名重复!'); return; } DataBase.ExecSql("INSERT INTO [会员信息] ( [会员名] ,[密码] ,[联系地址] ,[电话] ,[Email] ,[身份证号] ) VALUES ('" + txtUName.Text + "','" + txtPwd.Text + "','" + txtLXDZ.Text + "','" + txtDH.Text + "','" + txtEmail.Text + "','" + txtSFZH.Text + "')");
Session["User"] = this.txtUName.Text.Trim();
if (Request.QueryString["Tag"] == "I") { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "aert('保存成功!');window.location.href='Index.aspx';"); } if (Request.QueryString["Tag"] == "H") { Page.ClientScript.RegisterStartupScript(this.GetType(), "ino", "aert('保存成功!');window.location.href='index_History.aspx';"); } if (Request.QueryString["Tag"] == "P") { Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "alrt('保存成功!');window.location.href='index_Person.aspx';"); } }
|