protected void Button2_Click(object sender, EventArgs e) { Model.address mode = new Model.address(); mode.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress blla = new BLL.daladdress(); SqlDataReader dr = blla.dra(mode); if (dr.Read()) { Model.address mod = new Model.address(); mod.userid = Convert.ToInt32(Session["_userid"]); mod.mail = TextBox7.Text; mod.name = TextBox8.Text; mod.mobile = TextBox5.Text; mod.tel = TextBox6.Text; mod.Address = TextBox1.Text; BLL.daladdress blla1 = new BLL.daladdress(); int i = blla1.upad(mod); //Response.Write(i); if (i > 0) { Common.MessageAlert.Alert(Page, "提交成功!"); } else { Common.MessageAlert.Alert(Page, "提交失败!"); } } else { Model.address modd = new Model.address(); modd.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress bla = new BLL.daladdress(); int f = bla.inserid(modd); Model.address mod = new Model.address(); mod.userid = Convert.ToInt32(Session["_userid"]); mod.mail = TextBox7.Text; mod.name = TextBox8.Text; mod.mobile = TextBox5.Text; mod.tel = TextBox6.Text; mod.Address = TextBox1.Text; BLL.daladdress blla2 = new BLL.daladdress(); int i = blla2.upad(mod); if (i > 0) { Common.MessageAlert.Alert(Page, "提交成功!"); } else { Common.MessageAlert.Alert(Page, "提交失败!"); } } }
protected void Button2_Click(object sender, EventArgs e) { Model.address mode = new Model.address(); mode.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress blla = new BLL.daladdress(); MySqlDataReader dr = blla.dra(mode); if (dr.Read()) { Model.address mod = new Model.address(); mod.userid = Convert.ToInt32(Session["_userid"]); mod.mail = TextBox7.Text; mod.name = TextBox8.Text; mod.mobile = TextBox5.Text; mod.tel = TextBox6.Text; mod.Address = TextBox1.Text; BLL.daladdress blla1 = new BLL.daladdress(); int i = blla1.upad(mod); //Response.Write(i); if (i > 0) { Common.MessageAlert.Alert(Page, "提交成功!"); } else { Common.MessageAlert.Alert(Page, "提交失败!"); } } else { Model.address modd = new Model.address(); modd.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress bla = new BLL.daladdress(); int f = bla.inserid(modd); Model.address mod = new Model.address(); mod.userid =Convert.ToInt32(Session["_userid"]); mod.mail = TextBox7.Text; mod.name = TextBox8.Text; mod.mobile = TextBox5.Text; mod.tel = TextBox6.Text; mod.Address = TextBox1.Text; BLL.daladdress blla2 = new BLL.daladdress(); int i = blla2.upad(mod); if (i > 0) { Common.MessageAlert.Alert(Page, "提交成功!"); } else { Common.MessageAlert.Alert(Page, "提交失败!"); } } }
public void bindaddress() { Model.address myaddress = new Model.address(); myaddress.userid = Convert.ToInt32(Session["_userid"]); BLL.BLLshoplist2 blll = new BLL.BLLshoplist2(); MySqlDataReader dr = blll.readaddress(myaddress); if (dr.Read()) { address.Text = dr["_address"].ToString(); tel.Text = dr["_tel"].ToString(); mobile.Text = dr["_mobile"].ToString(); receivename.Text = dr["_name"].ToString(); mail.Text = dr["_mail"].ToString(); } dr.Close(); Label1.Text = receivename.Text+" "; Label2.Text = address.Text + " "; Label3.Text = mobile.Text + " "; Label4.Text = tel.Text + " "; Label5.Text = mail.Text + " "; }
public void drad() { Model.address moa = new Model.address(); moa.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress blla = new BLL.daladdress(); MySqlDataReader dr = blla.drad(moa); if (dr!= null) { if (dr.Read()) { TextBox7.Text = dr["_mail"].ToString(); TextBox8.Text = dr["_name"].ToString(); TextBox5.Text = dr["_mobile"].ToString(); TextBox6.Text = dr["_tel"].ToString(); TextBox1.Text = dr["_address"].ToString(); dr.Close(); } dr.Close(); } }
public void drad() { Model.address moa = new Model.address(); moa.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress blla = new BLL.daladdress(); SqlDataReader dr = blla.drad(moa); if (dr != null) { if (dr.Read()) { TextBox7.Text = dr["_mail"].ToString(); TextBox8.Text = dr["_name"].ToString(); TextBox5.Text = dr["_mobile"].ToString(); TextBox6.Text = dr["_tel"].ToString(); TextBox1.Text = dr["_address"].ToString(); dr.Close(); } dr.Close(); } }
public void bindaddress() { Model.address myaddress = new Model.address(); myaddress.userid = Convert.ToInt32(Session["_userid"]); BLL.BLLshoplist2 blll = new BLL.BLLshoplist2(); SqlDataReader dr = blll.readaddress(myaddress); if (dr.Read()) { address.Text = dr["_address"].ToString(); tel.Text = dr["_tel"].ToString(); mobile.Text = dr["_mobile"].ToString(); receivename.Text = dr["_name"].ToString(); mail.Text = dr["_mail"].ToString(); } dr.Close(); Label1.Text = receivename.Text + " "; Label2.Text = address.Text + " "; Label3.Text = mobile.Text + " "; Label4.Text = tel.Text + " "; Label5.Text = mail.Text + " "; }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (Page.IsValid == true) { Model.user mod = new Model.user(); mod.email = TextBox7.Text; BLL.userBLL bk = new BLL.userBLL(); MySqlDataReader dr = bk.pp(mod); if (dr != null) { if (dr.Read()) { Common.MessageAlert.Alert(Page, "该邮箱号已存在!"); TextBox7.Text=" "; dr.Close(); } else { Model.user mo = new Model.user(); mo.email = Server.HtmlEncode(TextBox7.Text); mo.pwd = Server.HtmlEncode(TextBox6.Text); mo.username = Server.HtmlEncode(TextBox8.Text); mo.qq = Server.HtmlEncode(TextBox2.Text); mo.msn = Server.HtmlEncode(TextBox3.Text); mo.safequestion = Server.HtmlEncode(TextBox4.Text); mo.safepwd = Server.HtmlEncode(TextBox5.Text); BLL.userBLL bll = new BLL.userBLL(); int i = bll.insert(mo); if (i > 0) { Common.MessageAlert.AlertLocation(Page, "alert('注册成功');location.href='Login.aspx'"); Model.user mod1 = new Model.user(); mod1.email = TextBox7.Text; BLL.userBLL blluser = new BLL.userBLL(); MySqlDataReader dr1 = blluser.drid(mod1); if (dr1.Read()) { Session["_userid"] = dr1["_userid"].ToString(); dr1.Close(); } dr1.Close(); Model.address moadd = new Model.address (); moadd.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress bld = new BLL.daladdress (); int f = bld.upada(moadd); TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; } else { Common.MessageAlert.Alert(Page, "注册失败!"); } } } } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (Page.IsValid == true) { Model.user mod = new Model.user(); mod.email = TextBox7.Text; BLL.user bk = new BLL.user(); SqlDataReader dr = bk.pp(mod); if (dr != null) { if (dr.Read()) { Common.MessageAlert.Alert(Page, "该邮箱号已存在!"); TextBox7.Text = " "; dr.Close(); } else { Model.user mo = new Model.user(); mo.email = Server.HtmlEncode(TextBox7.Text); mo.pwd = Server.HtmlEncode(TextBox6.Text); mo.username = Server.HtmlEncode(TextBox8.Text); mo.qq = Server.HtmlEncode(TextBox2.Text); mo.msn = Server.HtmlEncode(TextBox3.Text); mo.safequestion = Server.HtmlEncode(TextBox4.Text); mo.safepwd = Server.HtmlEncode(TextBox5.Text); BLL.user bll = new BLL.user(); int i = bll.insert(mo); if (i > 0) { Common.MessageAlert.AlertLocation(Page, "alert('注册成功');location.href='Login.aspx'"); Model.user mod1 = new Model.user(); mod1.email = TextBox7.Text; BLL.user blluser = new BLL.user(); SqlDataReader dr1 = blluser.findByMail(mod1); if (dr1.Read()) { Session["_userid"] = dr1["_userid"].ToString(); dr1.Close(); } dr1.Close(); Model.address moadd = new Model.address(); moadd.userid = Convert.ToInt32(Session["_userid"]); BLL.daladdress bld = new BLL.daladdress(); int f = bld.upada(moadd); TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; } else { Common.MessageAlert.Alert(Page, "注册失败!"); } } } } }