文件名称:ASPNET2.0网上购物电子商城
文件大小:1.6MB
文件格式:RAR
更新时间:2012-01-03 07:05:51
网上购物电子商城电子商城
ASPNET2.0网上购物电子商城using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class User_UserInfoEdit : System.Web.UI.Page { string strSql; DataTable dtTable; WebService webService = new WebService(); protected void Page_Load(object sender, EventArgs e) { if (Session["UserLevel"] == null || Session["UserLevel"].ToString() != "User") { Response.Redirect("Error.aspx"); } else { strSql = "select * from z_UserInfo where User_ID='" + Session["UserID"].ToString() + "'"; dtTable = webService.ReturnSql(strSql); this.tbName.Text = dtTable.Rows[0]["User_name"].ToString(); this.tbRealName.Text = dtTable.Rows[0]["User_realName"].ToString(); this.ddlSex.Text = dtTable.Rows[0]["User_sex"].ToString(); this.tbPhone.Text = dtTable.Rows[0]["User_tel"].ToString(); this.tbAddr.Text = dtTable.Rows[0]["User_address"].ToString(); this.tbZip.Text = dtTable.Rows[0]["User_zip"].ToString(); this.tbEmail.Text = dtTable.Rows[0]["User_email"].ToString(); } } protected void btnSubmit_Click(object sender, EventArgs e) { if (Page.IsValid) { string strName = tbName.Text; string strPsw = tbPsw.Text; string strRealName = tbRealName.Text; string strAddr = tbAddr.Text; string strZip = tbZip.Text; string strPhone = tbPhone.Text; string strEmail = tbEmail.Text; string strSex = ddlSex.SelectedValue; strSql = "Update z_UserInfo set User_psw='" + strPsw + "',User_realName='" + strRealName + "',User_sex='" + strSex + "',User_tel='" + strPhone + "',User_address='" + strAddr + "',User_zip='" + strZip + "',User_email='" + strEmail + "' where User_ID='" + Session["UserID"].ToString() + "';"; webService.ReturnNSql(strSql); Response.Redirect("User_UserInfo.aspx"); } } protected void btnCancel_Click(object sender, EventArgs e) { Response.Redirect("User_UserInfo.aspx"); } }