//登录 protected void LoginBtn_Click(object sender, EventArgs e) { //验证码对比 if (Session["valid"].ToString().ToUpper() != tbxSecurity.Text.Trim().ToUpper()) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "验证码无效!" + "');</script> "); } else { StoreUser newUser = new StoreUser(); StoreUserController newUserCon = new StoreUserController(); newUser.UserName = this.txbUserName.Text; newUser.PassWord = this.txbPassWord.Text; //判断是否激活 if (newUserCon.StoreUserConfirm(newUser) == true) { //判断是否密码一致 if (newUserCon.StoreUserLogin(newUser) == true) { Session["UserName"] = this.txbUserName.Text; Response.Redirect("PerInf_information.aspx"); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "密码错误" + "');</script> "); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "您的账号没有激活" + "');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserName"] == null) { this.Response.Redirect("../UserRegister/Login.aspx"); } else { btnSubmit.Enabled = false; PerInf_information Infomation = new PerInf_information(); StoreUser Userinfo = new StoreUser(); StoreUserController Getinfo = new StoreUserController(); Userinfo.UserName = Session["UserName"].ToString(); string[] lTemp = Getinfo.GetInfo(Userinfo); if (lTemp[11] != null) { tbxTrueName.Text = lTemp[11]; tbxTrueName.Enabled = false; } if (lTemp[4] != null) { if (lTemp[4] == "0") { rbtnMen.Checked = true; } else { rbtnWoman.Checked = true; } } if (lTemp[8] == "1") { rbtnAddress1.Checked = true; } else { if (lTemp[9] == "1") { rbtnAddress2.Checked = true; } else { if (lTemp[10] == "1") { rbtnAddress3.Checked = true; } } } tbxAddress1.Text = lTemp[0]; tbxAddress2.Text = lTemp[1]; tbxAddress3.Text = lTemp[2]; tbxNickName.Text = lTemp[3]; tbxAge.Text = lTemp[5]; tbxPhone.Text = lTemp[6]; tbxQQ.Text = lTemp[7]; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { //验证码验证 if (Session["valid"].ToString().Trim().ToUpper() != tbxSecutity.Text.Trim().ToUpper()) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ggg", "<script language='javascript'>alert('" + "验证码错误" + "');</script> "); } else { StoreUser newUser = new StoreUser(); //创建新实体类对象 StoreUserController newUserCon = new StoreUserController(); //创建新方法类对象 newUser.UserName = this.tbxUserName.Text; //传参 newUser.PassWord = this.tbxPassWord.Text; newUser.Email = this.tbxEmail.Text; newUser.IdCardNum = this.tbxIdcard.Text; newUser.UserTrueName = this.tbxTruename.Text; if (newUserCon.RegistStoreUser(newUser) == true) { UA uAdmin = new UA(); uAdmin.SendEmail(newUser); this.Response.Redirect("tip_register.aspx");//页面跳转 } else { Response.Write("插入失败");//提示信息 } } }
protected void btnExamUserName_Click(object sender, EventArgs e) { StoreUser user = new StoreUser(); user.UserName = this.tbxUserName.Text; StoreUserController StoreUserCon = new StoreUserController(); if (this.tbxUserName.Text != "") { if (StoreUserCon.StoreUserNameExam(user)) { this.labUserName.Text = "√"; this.labReturnInfo.Text = "用户名可以使用"; } else { this.labReturnInfo.Text = "该用户名已经存在"; } } else { this.labReturnInfo.Text = "用户名不能为空"; } this.ModalPopupExtender2.Show(); }
protected void btnSubmit_Click1(object sender, EventArgs e) { StoreUser User = new StoreUser(); StoreUserController user = new StoreUserController(); User.UserName = this.tbxUserName.Text; User.Email = this.tbxgEmail.Text; User.Idcard = this.tbxIdCard.Text; if (Session["valid"].ToString().Trim().ToUpper() != tbxSecurity.Text.ToUpper()) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "验证码错误" + "');</script> "); } else { if (user.FindPassword(User)) { UA uAdmin = new UA(); //uAdmin.SendEmail2(User); this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "邮件已发送到您的邮箱请验证" + "');</script> "); Response.Redirect("./Login.aspx"); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请确保所填的所有信息和注册时相同" + "');</script> "); } } }
protected void Button1_Click(object sender, EventArgs e) { if (Request.QueryString["SaveOrderID"] == null) { Response.Redirect("../UserRegister/PerInf_myorder.aspx"); } else { string str = Request.QueryString["SaveOrderID"];//获取OrderID StoreUser User = new StoreUser(); StoreUserController user = new StoreUserController(); if (txareCancleReson.Value != "") { if (user.cancelOrder(User, txareCancleReson.Value, str)) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "取消理由提交成功" + "');</script>"); CancleBtn.Text = "返回"; } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "取消理由提交失败" + "');</script>"); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请输入取消理由" + "');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserName"] == null) { this.Response.Redirect("../UserRegister/Login.aspx"); } else { StoreUser UserCount = new StoreUser(); StoreUserController Usercount = new StoreUserController(); tbxUserName.Text = Session["UserName"].ToString(); UserCount.UserName = Session["UserName"].ToString(); string[] ITemp = Usercount.UserCount(UserCount); if (ITemp[0] == "0") { tbxUserType.Text = "普通会员"; } else { tbxUserType.Text = "高级会员"; } tbxTotalConsum.Text = ITemp[1]; tbxTotalConsum.Enabled = false; tbxUserName.Enabled = false; tbxUserType.Enabled = false; } } }
protected void btnView2Next_Click(object sender, EventArgs e) { StoreUser User = new StoreUser(); StoreUserController user = new StoreUserController(); User.UserName = Session["UserName"].ToString(); if (tbxPassWord.Text == "") { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "原不能为空" + "');</script> "); } else { if (tbxPassWord.Text == PW) { User.PassWord = this.tbxAgainPassWord.Text; if (user.ChangeIdCard(User)) { //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "修改成功" + "');</script> "); MultiView1.ActiveViewIndex = 2; } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "修改失败" + "');</script> "); } } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "原密码输入错误" + "');</script> "); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { StoreUser User = new StoreUser(); StoreUserController IdCard = new StoreUserController(); User.UserName = Session["UserName"].ToString(); string a = IdCard.Idcard(User); string[] ab = a.Split('m'); PW = ab[1]; Id = ab[0]; if (ab[0].Length == 15) { string b = ab[0].Substring(0, 3); string c = ab[0].Substring(11, 3); string d = b + "*********" + c; this.tbxFormerIdCard.Text = d; } if (ab[0].Length == 18) { string b = ab[0].Substring(0, 3); string c = ab[0].Substring(15, 3); string d = b + "************" + c; tbxFormerIdCard.Text = d; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["ImageAddress"] == null) { Response.Redirect("../GoodDisplay/ProductShow.aspx"); } else { if (Session["UserName"] == null || Session["UserName"] == "") { mUserName = null; } else { mUserName = Session["UserName"].ToString(); } StoreUser User = new StoreUser(); StoreUserController User1 = new StoreUserController(); string ImageAddress = Request.QueryString["ImageAddress"]; imgGoodShow.Src = ImageAddress; ImgInfo imgInfo = new ImgInfo(); imgInfo.ImgAddress = ImageAddress; int GoodID = ImgInfo.ImgAddressGetGoodID(imgInfo); SingleGoodInfo singleGoodinfo = new SingleGoodInfo(); singleGoodinfo.GoodID = GoodID; int SingleGoodID = SingleGoodInfo.mGoodIDGetSingleGoodID(singleGoodinfo); mSingleGoodID = SingleGoodID; if (GoodID == 0 || GoodID == null) { Response.Redirect("../GoodDisplay/ProductShow.aspx"); } List <Good> goodInfo = new List <Good>(); List <ImgInfo> imgTiele = new List <ImgInfo>(); Order Goodinfo = new Order(); OrderController GoodInfo = new OrderController(); goodInfo = GoodInfo.Goodinfo(Goodinfo, GoodID); imgTiele = GoodInfo.GoodTitle(Goodinfo, GoodID); lbGoodPrice.Text = goodInfo[0].GoodPrice; lbGoodID.Text = goodInfo[0].GoodID.ToString(); lbFirstName.Text = goodInfo[0].GoodName; lbSecondName.Text = imgTiele[0].ImgTitle; lbMoney.Text = lbGoodPrice.Text; mGoodCount = Convert.ToDouble(lbGoodPrice.Text); mGoodIncontory = goodInfo[0].GoodIncentory; this.linkbtn_FirstName.Text = Good.GoodIDGetFirstClassName(GoodID); this.linkbtn_SecondName.Text = Good.GoodIDGetSecondClassName(GoodID); this.linkbtn_ThirdName.Text = Good.GoodIDGetThirdClassName(GoodID); this.linkbtn_FirstName.PostBackUrl = "~/formerstage/GoodDisplay/FirstClass.aspx?FirstName=" + this.linkbtn_FirstName.Text + ""; this.linkbtn_SecondName.PostBackUrl = "~/formerstage/GoodDisplay/SecondClass.aspx?SecondName=" + this.linkbtn_SecondName.Text + ""; this.linkbtn_ThirdName.PostBackUrl = "~/formerstage/GoodDisplay/ThirdClass.aspx?ThirdName=" + this.linkbtn_ThirdName.Text + ""; this.DataList1.DataSource = SingleGoodInfo.GetSingleGoodInfo(GoodID); DataList1.DataBind(); } } }
protected void palConfirmInfo_Load(object sender, EventArgs e) { if (IsPostBack) { if (Session["UserName"] == null) { //this.Response.Redirect("../UserRegister/Login.aspx"); } else { StoreUser User = new StoreUser(); StoreUserController User1 = new StoreUserController(); string ImageAddress = Request.QueryString["ImageAddress"]; ImgInfo imgInfo = new ImgInfo(); imgInfo.ImgAddress = ImageAddress; int GoodID = ImgInfo.ImgAddressGetGoodID(imgInfo); SingleGoodInfo singleGoodinfo = new SingleGoodInfo(); singleGoodinfo.GoodID = GoodID; int SingleGoodID = SingleGoodInfo.mGoodIDGetSingleGoodID(singleGoodinfo); mSingleGoodID = SingleGoodID; User.UserName = Session["UserName"].ToString(); List <StoreUser> order = new List <StoreUser>(); order = User1.OrderConfirm(User); lbUserName.Text = order[0].UserTrueName; tbxUserPhone.Text = order[0].Phone; lbMoney.Text = mGoodCount.ToString(); if (tbxUserPhone.Text != "") { if (order[0].Address1 != "") { tbxAddress1.Text = order[0].Address1; if (order[0].IsDafult1 == "1") { rbtnAddress1.Checked = true; } } if (order[0].Address2 != "") { tbxAddress2.Text = order[0].Address2; if (order[0].IsDafult2 == "1") { rbtnAddress2.Checked = true; } } if (order[0].Address3 != "") { tbxAddress3.Text = order[0].Address3; if (order[0].IsDafult3 == "1") { rbtnAddress3.Checked = true; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["SaveOrderID"] == null) { Response.Redirect("../UserRegister/PerInf_myorder.aspx"); } else { string str = Request.QueryString["SaveOrderID"]; StoreUser User = new StoreUser(); StoreUserController user = new StoreUserController(); Order orderExam = new Order(); OrderController orderexam = new OrderController(); string[] orderInfo = user.OrderInfo(User, str); tbxUserName.Text = orderInfo[1]; tbxPhoneNumber.Text = orderInfo[2]; tbxEmail.Text = orderInfo[0]; tbxReveiveAddress.Text = orderInfo[3]; orderExam.OrderID = str; OrderLisstview.DataSource = orderexam.OrderExam(orderExam); OrderLisstview.DataBind(); } }
protected void OkButton_Click(object sender, EventArgs e) { StoreUser Userinfo = new StoreUser(); StoreUserController UserInfo = new StoreUserController(); //修改信息 Userinfo.UserName = Session["UserName"].ToString(); Userinfo.Address1 = tbxAddress1.Text; Userinfo.Address2 = tbxAddress2.Text; Userinfo.Address3 = tbxAddress3.Text; Userinfo.NickName = tbxNickName.Text; Userinfo.Phone = tbxPhone.Text; Userinfo.QQ = tbxQQ.Text; Userinfo.Age = tbxAge.Text; if (rbtnAddress1.Checked == true) { Userinfo.IsDafult1 = "1"; if (rbtnAddress2.Checked == true) { Userinfo.IsDafult2 = "1"; if (rbtnAddress3.Checked == true) { Userinfo.IsDafult3 = "1"; } else { Userinfo.IsDafult3 = "0"; } } else { Userinfo.IsDafult2 = "0"; if (rbtnAddress3.Checked == true) { Userinfo.IsDafult3 = "1"; } else { Userinfo.IsDafult3 = "0"; } } } else { Userinfo.IsDafult1 = "0"; if (rbtnAddress2.Checked == true) { Userinfo.IsDafult2 = "1"; if (rbtnAddress3.Checked == true) { Userinfo.IsDafult3 = "1"; } else { Userinfo.IsDafult3 = "0"; } } else { Userinfo.IsDafult2 = "0"; if (rbtnAddress3.Checked == true) { Userinfo.IsDafult3 = "1"; } else { Userinfo.IsDafult3 = "0"; } } } if (rbtnMen.Checked == true) { Userinfo.Sex = "0"; } else { if (rbtnWoman.Checked == true) { Userinfo.Sex = "1"; } } if (UserInfo.Update(Userinfo)) { lbtext.Text = "修改成功"; OkButton.Visible = false; CancelButton.Text = "确定"; ModalPopupExtender1.Show(); } else { lbtext.Text = "修改失败"; OkButton.Visible = false; CancelButton.Text = "确定"; ModalPopupExtender1.Show(); } }
protected void btnSubmitOrder_Click(object sender, EventArgs e) { if (Session["UserName"] == null) { Response.Redirect("Login.aspx"); } else { if (lbUserName.Text == "" || (tbxAddress1.Text == "" && tbxAddress2.Text == "" && tbxAddress3.Text == "")) { //lbShow.Text = "请填写信息"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请填写信息" + "');</script>"); } else { if (tbxUserPhone.Text == "") { //lbShow.Text = "请填写电话"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请填写电话" + "');</script>"); } else { int lCount = Convert.ToInt32(tbxGoodCount.Text); double lPrice = Convert.ToDouble(lbGoodPrice.Text); string userName = Session["UserName"].ToString(); Order order = new Order(); OrderController Order = new OrderController(); StoreUser user = new StoreUser(); StoreUserController user1 = new StoreUserController(); user.UserName = userName; user.Address1 = tbxAddress1.Text; user.Address2 = tbxAddress2.Text; user.Address3 = tbxAddress3.Text; user.Phone = tbxUserPhone.Text; lbMoney.Text = mGoodCount.ToString(); if (user1.OrderUpdateUserinfo(user)) { order.Number = Convert.ToInt32(tbxGoodCount.Text); order.TotalPrices = lCount * lPrice; order.UserID = StoreUser.UserNameGetID(user); order.SingleGoodID = mSingleGoodID; if ((rbtnAddress1.Checked == true && tbxAddress1.Text == "")) { //lbShow.Text = "请选择正确的地址"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请选择正确的地址" + "');</script>"); } else { if ((rbtnAddress2.Checked == true && tbxAddress2.Text == "")) { //lbShow.Text = "请选择正确的地址"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请选择正确的地址" + "');</script>"); } else { if ((rbtnAddress3.Checked == true && tbxAddress3.Text == "")) { //lbShow.Text = "请选择正确的地址"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请选择正确的地址" + "');</script>"); } else { if (rbtnAddress1.Checked == false && rbtnAddress2.Checked == false && rbtnAddress3.Checked == false) { //lbShow.Text = "请选择发货地址"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "请选择发货地址" + "');</script>"); } else { if (mGoodIncontory <= 3 || Convert.ToInt32(tbxGoodCount.Text) > mGoodIncontory) { //lbShow.Text = "库存不足"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "库存不足" + "');</script>"); } else { if (Order.CreateOrder(order, lAddressNumber)) { //lbShow.Text = "订单发送成功"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "订单发送成功" + "');</script>"); ModalPopupExtender1.Hide(); } else { //lbShow.Text = "订单发送失败"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "订单发送失败" + "');</script>"); ModalPopupExtender1.Hide(); } } } } } } } else { //lbShow.Text = "信息提交错误"; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "信息提交错误" + "');</script>"); } } } } }