Esempio n. 1
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.user      bls = new BLL.user();
            SqlDataReader dr  = bls.checkById(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.user blur = new BLL.user();
            int      i    = blur.loginLastTime(mod);
        }
        //下载于www.mycodes.net
    }
Esempio n. 2
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (Page.IsValid == true)
     {
         Model.user mos = new Model.user();
         mos.userid = Convert.ToInt32(Session["_user_id"]);
         mos.pwd    = TextBox7.Text;
         BLL.user      blus = new BLL.user();
         SqlDataReader dr   = blus.drp(mos);
         if (dr.Read())
         {
             Model.user mod = new Model.user();
             mod.userid = Convert.ToInt32(Session["_user_id"]);
             mod.pwd    = Server.HtmlEncode(TextBox9.Text);
             BLL.user bllu = new BLL.user();
             int      i    = bllu.upwd(mod);
             if (i > 0)
             {
                 Common.MessageAlert.Alert(Page, "密码修改成功!");
             }
             else
             {
                 Common.MessageAlert.Alert(Page, "密码修改不成功!");
             }
             dr.Close();
         }
         else
         {
             Common.MessageAlert.Alert(Page, "原密码错误!");
         }
     }
 }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BLL.Shoping         blfac   = new BLL.Shoping();
        BLL.user            blluser = new BLL.user();
        BLL.Product_Comment bllsup  = new BLL.Product_Comment();
        BLL.SuccessStory    bllsto  = new BLL.SuccessStory();

        lnkNotPay.Text       = string.Format("واریز نشده امروز({0})", blfac.shop_factor_select_nopeyment_today().Rows.Count);
        lnkPayToday.Text     = string.Format("واریز شده امروز({0})", blfac.shop_factor_select_peyment_today().Rows.Count);
        lnkNewUser.Text      = string.Format("کاربر جدید امروز({0})", blluser.shop_user_select_new_today().Rows.Count);
        lnkMessage.Text      = string.Format("نظرجدید({0})", bllsup.select_today().Rows.Count);
        lnkSuccessStory.Text = string.Format("داستان موفقیت({0})", bllsto.DeactiveCount());
    }
Esempio n. 4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Model.user mo = new Model.user();
        mo.userid       = Convert.ToInt32(Session["_user_id"]);
        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.user bllu = new BLL.user();
        int      i    = bllu.upus(mo);

        if (i > 0)
        {
            Common.MessageAlert.Alert(Page, "修改成功!");
        }
        else
        {
            Common.MessageAlert.Alert(Page, "修改失败!");
        }
    }
Esempio n. 5
0
    public void pp()
    {
        Model.user mod = new Model.user();
        mod.userid = Convert.ToInt32(Session["_user_id"]);
        BLL.user      bll = new BLL.user();
        SqlDataReader dr  = bll.drs(mod);

        if (dr != null)
        {
            if (dr.Read())
            {
                Label2.Text   = dr["_email"].ToString();
                Label1.Text   = dr["_user_name"].ToString();
                TextBox5.Text = dr["_msn"].ToString();
                TextBox6.Text = dr["_qq"].ToString();
                TextBox1.Text = dr["_safe_question"].ToString();
                TextBox2.Text = dr["_safe_pwd"].ToString();
            }
            dr.Close();
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Regex r = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");

        if (Request["email"] != null && Request["email"].Trim().Length > 0)
        {
            string email = Request["email"].ToString();

            //判断邮箱格式是否正确
            if (r.IsMatch(email))
            {
                Model.user mod = new Model.user();
                mod.email = email;
                BLL.user bk = new BLL.user();

                SqlDataReader dr = bk.pp(mod);

                if (dr.Read())
                {
                    Response.Write("0");
                    Response.End();
                }
                else
                {
                    Response.Write("1");
                    Response.End();
                }
            }
            else
            {
                Response.Write("2");
                Response.End();
            }
        }
        else
        {
            Response.Write("3");
            Response.End();
        }
    }
Esempio n. 7
0
    protected void ImageButton1_Click(object sender, EventArgs e)
    {
        string email = Server.HtmlEncode(Request["logname"]);
        string pwd   = Server.HtmlEncode(Request["logpass"]);

        Model.user mod = new Model.user();
        mod.email = email;
        mod.pwd   = pwd;

        BLL.user      bll = new BLL.user();
        SqlDataReader dr  = bll.login(mod);

        //ds.Tables[0].Rows[0]["_user_id"];
        if (true)
        {
            SqlDataReader dr1 = bll.lo(mod);
            if (dr1.Read())
            {
                Session["_user_name"] = dr1["_user_name"].ToString();
                Session["_user_id"]   = dr1["_user_id"].ToString();

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

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



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

                    BLL.user      bllu = new BLL.user();
                    int           r    = bllu.update(mol);
                    SqlDataReader dr2  = bll.lo(mod);
                    if (dr2.Read())
                    {
                        Session["_user_name"] = dr2["_user_name"].ToString();
                        Session["_user_id"]   = dr2["_user_id"].ToString();
                        dr2.Close();
                    }
                    dr2.Close();
                }

                else
                {
                    Common.MessageAlert.Alert(Page, "登入失败!");
                }
            }
        }
    }
Esempio n. 8
0
    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, "注册失败!");
                    }
                }
            }
        }
    }
Esempio n. 9
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.user      bll = new BLL.user();
        SqlDataReader dr  = bll.login(mod);

        if (CheckBox1.Checked)
        {
            SqlDataReader 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.user      bllu = new BLL.user();
                    int           r    = bllu.loginLastTime(mol);
                    SqlDataReader 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, "验证码错误!");
            }
        }
    }