Exemplo n.º 1
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            Model.user mos = new Model.user();
            mos.userid = Convert.ToInt32(Session["_userid"]);
            mos.pwd = TextBox7.Text;
            BLL.userBLL blus = new BLL.userBLL();
            MySqlDataReader dr = blus.drp(mos);
            if (dr.Read())
            {

                Model.user mod = new Model.user();
                mod.userid = Convert.ToInt32(Session["_userid"]);
                mod.pwd = Server.HtmlEncode(TextBox9.Text);
                BLL.userBLL bllu = new BLL.userBLL();
                int i = bllu.upwd(mod);
                if (i > 0)
                {
                    Common.MessageAlert.Alert(Page, "密码修改成功!");
                }
                else
                {
                    Common.MessageAlert.Alert(Page, "密码修改不成功!");
                }
                dr.Close();

            }
            else
            {
                Common.MessageAlert.Alert(Page, "原密码错误!");
            }
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["_userid"] == null)
        {
            Common.MessageAlert.AlertLocation(Page, "alert('对不起,您没有登陆!');location.href='Login.aspx'");
        }
        else
        {
            Label1.Text=Session["_username"].ToString();

            Model.user mol = new  Model.user ();
            mol.userid = Convert.ToInt32(Session["_userid"]);
            BLL.userBLL bls = new BLL.userBLL();
            MySqlDataReader dr = bls.drti(mol);
            if (dr.Read())
            {
                Label2.Text = dr["_logintime"].ToString();
            }
            DateTime dt = DateTime.Now;
            Model.user mod = new Model.user();
            mod.userid = Convert.ToInt32(Session["_userid"]);
            mod.time = dt;
            BLL.userBLL blur = new BLL.userBLL();
            int i = blur.update(mod);
        }
    }
Exemplo n.º 3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.user mo = new Model.user();
     mo.userid = Convert.ToInt32(Session["_userid"]);
     mo.msn = Server.HtmlEncode(TextBox5.Text);
     mo.qq =Server.HtmlEncode(TextBox6.Text);
     mo.safequestion =Server.HtmlEncode(TextBox1.Text);
     mo.safepwd =Server.HtmlEncode(TextBox2.Text);
     BLL.userBLL bllu = new BLL.userBLL();
     int i = bllu.upus(mo);
     if (i > 0)
     {
         Common.MessageAlert.Alert(Page, "修改成功!");
     }
     else
     {
         Common.MessageAlert.Alert(Page,"修改失败!");
     }
 }
Exemplo n.º 4
0
 public void pp()
 {
     Model.user mod = new Model.user();
     mod.userid = Convert.ToInt32(Session["_userid"]);
     BLL.userBLL bll = new BLL.userBLL();
     MySqlDataReader dr = bll.drs(mod);
     if(dr!=null)
     {
         if (dr.Read())
         {
             Label2.Text = dr["_email"].ToString();
             Label1.Text = dr["_username"].ToString();
             TextBox5.Text = dr["_msn"].ToString();
             TextBox6.Text = dr["_qq"].ToString();
             TextBox1.Text = dr["_safequestion"].ToString();
             TextBox2.Text = dr["_safepwd"].ToString();
         }
         dr.Close();
     }
 }
Exemplo n.º 5
0
    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, "注册失败!");
                    }
                }
            }
        }
    }
Exemplo n.º 6
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string email = Server.HtmlEncode(TextBox3.Text);
        string pwd = Server.HtmlEncode(TextBox4.Text);
        Model.user mod = new Model.user();
        mod.email = email;
        mod.pwd = pwd;

        BLL.userBLL bll = new BLL.userBLL();
        MySqlDataReader  dr = bll.login(mod);
        //ds.Tables[0].Rows[0]["_userid"];
        if (CheckBox1.Checked)
        {
            MySqlDataReader dr1 = bll.lo(mod);
            if (dr1.Read())
            {
                Session["_username"] = dr1["_username"].ToString();
                Session["_userid"]=dr1["_userid"].ToString();

                dr1.Close();
            }
            dr1.Close();
        }
        else
        {
            Session["_username"] = "";
        }

        if (Session["CheckCode"] != null)
        {

            if (TextBox1.Text.ToLower() == Session["CheckCode"].ToString().ToLower())
            {

                if (dr.Read())
                {
                    Response.Redirect("ACIndex.aspx");

                    Model.user mol = new Model.user();
                    mol.userid = Convert.ToInt32(Session["_userid"]);

                    BLL.userBLL bllu = new BLL.userBLL();
                    int r = bllu.update(mol);
                    MySqlDataReader dr2 = bll.lo(mod);
                    if (dr2.Read())
                    {
                        Session["_username"] = dr2["_username"].ToString();
                        Session["_userid"] = dr2["_userid"].ToString();
                        dr2.Close();
                    }
                    dr2.Close();
                }

                else
                {
                    Common.MessageAlert.Alert(Page, "登入失败!");
                }

            }
            else
            {
                Common.MessageAlert.Alert(Page, "验证码错误!");

            }

        }
    }