protected void btnModifyPwd_Click(object sender, EventArgs e)
    {
        //验证用户名与密码是否正确
        int       ErrorID      = 0;
        string    ErrorMsg     = "";
        DataTable dt           = new DataTable();
        string    strLoginName = Page.User.Identity.Name;
        string    strPassword  = txtOldPwd.Text.Trim();

        Tz888.BLL.Login.LoginInfoBLL           obj  = new Tz888.BLL.Login.LoginInfoBLL();
        Tz888.SQLServerDAL.LoginInfo.LoginInfo obj2 = new Tz888.SQLServerDAL.LoginInfo.LoginInfo();
        dt = obj.Authenticate(strLoginName, 0, strPassword, true, ref ErrorID, ref ErrorMsg);

        if (dt.Rows.Count > 0)
        {
            string strNewPassword = txtNewPwd.Text.Trim();
            //修改密码
            if (obj2.ChangePassword(strLoginName, strNewPassword))
            {
                Tz888.Common.MessageBox.Show(this.Page, "修改成功!");
            }
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "您输入的旧密码不正确!");
        }
    }
Exemple #2
0
    protected void IbtnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        int       ErrorID      = 0;
        string    ErrorMsg     = "";
        DataTable dt           = new DataTable();
        string    strLoginName = Page.User.Identity.Name;
        string    strPassword  = txtUserPwd.Value.ToString().Trim();

        Tz888.BLL.Login.LoginInfoBLL            obj            = new Tz888.BLL.Login.LoginInfoBLL();
        Tz888.SQLServerDAL.LoginInfo.LoginInfo  obj2           = new Tz888.SQLServerDAL.LoginInfo.LoginInfo();
        List <Tz888.Model.Common.IndustryModel> industryModels = new List <Tz888.Model.Common.IndustryModel>(); //融资行业实体列表

        dt = obj.Authenticate(strLoginName, 0, strPassword, true, ref ErrorID, ref ErrorMsg);

        if (dt.Rows.Count > 0)
        {
            industryModels = this.SelectIndustryControl1.IndustryModels;

            SHA1     sha1      = SHA1.Create();
            byte[]   passWord2 = sha1.ComputeHash(Encoding.Unicode.GetBytes(this.txtUserPwd.Value.ToString().Trim()));
            string   name      = Page.User.Identity.Name;
            string[] num       = member.SelMemberNews(name).Split('&');

            company.UserName    = name;                                                                                                                              //用户名
            company.UserPwd     = passWord2;                                                                                                                         //密码
            company.TelPhone    = txtTelCountry.Value.ToString().Trim() + "-" + txtTelZoneCode.Value.ToString().Trim() + "-" + txtTelNumber.Value.ToString().Trim(); //电话号码
            company.Mobile      = txtMobile.Value.ToString().Trim();                                                                                                 //手机号码
            company.Email       = txtEmail.Value.ToString().Trim();                                                                                                  //电子邮箱
            company.Audit       = 0;                                                                                                                                 //审核状态
            company.StartTime   = DateTime.Now;                                                                                                                      //发布时间
            company.Valid       = 0;                                                                                                                                 //展厅有效期
            company.CompanyName = txtCompanyName.Value.ToString().Trim();                                                                                            //企业名称
            company.Typename    = num[6].ToString();                                                                                                                 //所属类型
            company.Countrycode = ZoneSelectControl1.CountryID;
            company.Provinceid  = ZoneSelectControl1.ProvinceID;
            company.Cityid      = ZoneSelectControl1.CityID;
            company.Countyid    = ZoneSelectControl1.CountyID;
            company.OrderId     = 0;
            //结束处
            foreach (Tz888.Model.Common.IndustryModel model in industryModels)
            {
                company.Industry += model.IndustryBID + ",";
            }

            company.Recomm = "推荐地方";
            int add = show.tzAddShow(company);
            if (add != 1)
            {
                Tz888.Common.MessageBox.Show(this.Page, "添加失败");
            }
            else
            {
                Tz888.Common.MessageBox.ShowAndHref("添加成功", "tzPost.aspx");
            }
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "您输入密码不正确,请重新输入!");
        }
    }
    protected void BtnUpdatePwd_Click(object sender, EventArgs e)
    {
        //验证用户名与密码是否正确
        string strLoginName = this.LblUserName.Text.Trim();
        string strPassword  = this.TxtPwd.Text.Trim();

        Tz888.SQLServerDAL.LoginInfo.LoginInfo obj2 = new Tz888.SQLServerDAL.LoginInfo.LoginInfo();

        string strNewPassword = this.TxtRePwd.Text.Trim();

        if (strNewPassword == "")
        {
            return;
        }
        //修改密码
        if (obj2.ChangePassword(strLoginName, strNewPassword))
        {
            Response.Write("<script>alert('修改成功!');window.open('http://member.topfo.com/','_self');</script>");
        }
        else
        {
            Tz888.Common.MessageBox.Show(this.Page, "修改失败!请重试!");
        }
    }