Пример #1
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.TxtPasswords.Text != this.TxtConfirmPassword.Text)
            {
                DynamicPage.WriteErrMsg("<li>确认密码与新密码不一致!</li>");
            }
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);

            if (StringHelper.MD5(this.TxtOldPassword.Text.Trim()) != usersByUserName.UserPassword)
            {
                DynamicPage.WriteErrMsg("<li>输入的旧密码不正确!</li>");
            }
            else
            {
                usersByUserName.UserPassword = StringHelper.MD5(this.TxtPasswords.Text);
                if (ApiData.IsAPiEnable())
                {
                    string str = ApiFunction.UpdateUser(usersByUserName.UserName, this.TxtPasswords.Text, null, null, null, null, null, null, null, null, null, null, null, null, null);
                    if (str != "true")
                    {
                        DynamicPage.WriteErrMsg("<li>" + str + "</li>");
                    }
                }
                Users.Update(usersByUserName);
                DynamicPage.WriteSuccessMsg("<li>密码修改成功!</li>");
            }
        }
Пример #2
0
        protected void BtnStep3_Click(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(this.TxtUserName.Text);

            usersByUserName.UserPassword = StringHelper.MD5(this.TxtPassword.Text);
            if (ApiData.IsAPiEnable())
            {
                string str = ApiFunction.UpdateUser(usersByUserName.UserName, this.TxtPassword.Text, null, null, null, null, null, null, null, null, null, null, null, null, null);
                if (str != "true")
                {
                    DynamicPage.WriteErrMsg("<li>" + str + "</li>");
                }
            }
            if (Users.Update(usersByUserName))
            {
                DynamicPage.WriteSuccessMsg("修改密码成功!", "default.aspx");
            }
        }
Пример #3
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);

            if (!string.IsNullOrEmpty(this.TxtUserPassword.Text))
            {
                usersByUserName.UserPassword = StringHelper.MD5(this.TxtUserPassword.Text.ToLower());
            }
            if (!string.IsNullOrEmpty(this.TxtAnswer.Text))
            {
                usersByUserName.Answer = StringHelper.MD5(this.TxtAnswer.Text);
            }
            usersByUserName.Question       = this.TxtQuestion.Text;
            usersByUserName.Email          = this.TxtEmail.Text;
            usersByUserName.UserFace       = this.TxtUserFace.Text;
            usersByUserName.FaceWidth      = DataConverter.CLng(this.TxtFaceWidth.Text);
            usersByUserName.FaceHeight     = DataConverter.CLng(this.TxtFaceHeight.Text);
            usersByUserName.Sign           = this.TxtSign.Text;
            usersByUserName.PrivacySetting = DataConverter.CLng(this.RadlPrivacySetting.SelectedValue);
            usersByUserName.UserTrueName   = this.TxtTrueName.Text.Trim();
            ContacterInfo contacterInfo = new ContacterInfo();

            contacterInfo.ContacterId = DataConverter.CLng(this.HdnContacterID.Value);
            contacterInfo.UserName    = usersByUserName.UserName;
            contacterInfo.TrueName    = this.TxtTrueName.Text;
            contacterInfo.Title       = this.TxtTitle.Text;
            this.PersonalInformation1.GetContacter(contacterInfo);
            this.LiaisonInformation1.GetContacter(contacterInfo);
            usersByUserName.Sex          = this.PersonalInformation1.UserSex;
            contacterInfo.Company        = this.TxtCompany.Text;
            contacterInfo.Department     = this.TxtDepartment.Text;
            contacterInfo.Position       = this.TxtPosition.Text;
            contacterInfo.Operation      = this.TxtOperation.Text;
            contacterInfo.CompanyAddress = this.TxtCompanyAddress.Text;
            contacterInfo.ClientId       = 0;
            contacterInfo.ParentId       = 0;
            contacterInfo.CreateTime     = DateTime.Now;
            contacterInfo.Owner          = "";
            contacterInfo.UserType       = ContacterType.EnterpriceMainContacter;
            contacterInfo.UpdateTime     = DateTime.Now;
            if (ApiData.IsAPiEnable())
            {
                string str = ApiFunction.UpdateUser(usersByUserName.UserName, this.TxtUserPassword.Text, usersByUserName.Email, usersByUserName.Question, this.TxtAnswer.Text, usersByUserName.UserTrueName, usersByUserName.Sex.ToString(), contacterInfo.Birthday.ToString(), contacterInfo.QQ, contacterInfo.Msn, contacterInfo.Mobile, contacterInfo.OfficePhone, contacterInfo.Address, contacterInfo.ZipCode, contacterInfo.Homepage);
                if (str != "true")
                {
                    DynamicPage.WriteErrMsg("<li>" + str + "</li>");
                }
            }
            if (Users.Update(usersByUserName, contacterInfo))
            {
                if (usersByUserName.UserType == UserType.Creator)
                {
                    this.Company1.Action    = "modify";
                    this.Company1.CompanyId = usersByUserName.CompanyId;
                    Company.Update(this.Company1.CompanyInfo);
                }
                DynamicPage.WriteSuccessMsg("<li>修改" + PEContext.Current.User.UserName + "会员信息成功!</li>", "../Default.aspx");
            }
            else
            {
                DynamicPage.WriteErrMsg("<li>修改" + PEContext.Current.User.UserName + "会员信息失败!</li>");
            }
        }
Пример #4
0
        protected void btnSendEmail_Click(object sender, EventArgs e)
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(this.TxtUserName.Text);

            if (this.RadPwdType.SelectedValue == "0")
            {
                string newPassword = this.m_NewPassword;
                usersByUserName.UserPassword = StringHelper.MD5(newPassword);
                MailInfo mailInfo = new MailInfo();
                mailInfo.FromName = SiteConfig.SiteInfo.WebmasterEmail;
                List <MailAddress> list = new List <MailAddress>();
                list.Add(new MailAddress(usersByUserName.Email));
                mailInfo.MailToAddressList = list;
                mailInfo.MailBody          = "你在" + SiteConfig.SiteInfo.SiteName + "网站的用户新密码为" + newPassword + ",请及时到" + SiteConfig.SiteInfo.SiteUrl + "用户中心登录修改密码!";
                mailInfo.Subject           = "新密码已发送到你的邮箱";
                if (SendMail.Send(mailInfo) == MailState.Ok)
                {
                    if (ApiData.IsAPiEnable())
                    {
                        string str2 = ApiFunction.UpdateUser(usersByUserName.UserName, newPassword, null, null, null, null, null, null, null, null, null, null, null, null, null);
                        if (str2 != "true")
                        {
                            DynamicPage.WriteErrMsg("<li>" + str2 + "</li>");
                        }
                    }
                    if (Users.Update(usersByUserName))
                    {
                        DynamicPage.WriteSuccessMsg("新密码已发送到你的邮箱!请注意查收并及时修改密码! 如无法接收到,请与网站管理员联系!", "../default.aspx");
                    }
                    else
                    {
                        DynamicPage.WriteErrMsg("新密码已发送到你的邮箱!但网站系统无法修改旧密码,使用新密码可能无法登录! 请与网站管理员联系!", "../default.aspx");
                    }
                }
                else
                {
                    DynamicPage.WriteErrMsg("新密码发送到你的邮箱时不成功,请与网站管理员联系!", "../default.aspx");
                }
            }
            else
            {
                string input = this.m_NewPassword;
                usersByUserName.PayPassword = StringHelper.MD5(input);
                MailInfo info3 = new MailInfo();
                info3.FromName = SiteConfig.SiteInfo.WebmasterEmail;
                List <MailAddress> list2 = new List <MailAddress>();
                list2.Add(new MailAddress(usersByUserName.Email));
                info3.MailToAddressList = list2;
                info3.MailBody          = "你在" + SiteConfig.SiteInfo.SiteName + "网站的用户新预付款支付密码为" + input + ",请及时到" + SiteConfig.SiteInfo.SiteUrl + "用户中心登录修改预付款支付密码!";
                info3.Subject           = "新预付款支付密码已发送到你的邮箱";
                if (SendMail.Send(info3) == MailState.Ok)
                {
                    if (Users.Update(usersByUserName))
                    {
                        DynamicPage.WriteSuccessMsg("新预付款支付密码已发送到你的邮箱!请注意查收并及时修改密码! 如无法接收到,请与网站管理员联系!", "../default.aspx");
                    }
                    else
                    {
                        DynamicPage.WriteErrMsg("新预付款支付密码已发送到你的邮箱!但网站系统无法修改旧密码,使用新密码可能无法登录! 请与网站管理员联系!", "../default.aspx");
                    }
                }
                else
                {
                    DynamicPage.WriteErrMsg("新预付款支付密码发送到你的邮箱时不成功,请与网站管理员联系!", "../default.aspx");
                }
            }
        }
Пример #5
0
 protected void BtnStep2_Click(object sender, EventArgs e)
 {
     this.PnlStep1.Visible = false;
     this.PnlStep2.Visible = false;
     if (this.TxtValidateCode.Text == this.VcodeLogOn.ValidateCodeValue)
     {
         UserInfo usersByUserName = Users.GetUsersByUserName(this.TxtUserName.Text);
         if (!usersByUserName.IsNull)
         {
             string str = StringHelper.MD5(this.TxtAnswer.Text);
             if (this.RadListPwdType.SelectedValue == "0")
             {
                 if (StringHelper.ValidateMD5(usersByUserName.Answer, str))
                 {
                     if (SiteConfig.UserConfig.UserGetPasswordType != 0)
                     {
                         string newPassword = this.m_NewPassword;
                         usersByUserName.UserPassword = StringHelper.MD5(newPassword);
                         MailInfo mailInfo = new MailInfo();
                         mailInfo.FromName = SiteConfig.SiteInfo.WebmasterEmail;
                         List <MailAddress> list = new List <MailAddress>();
                         list.Add(new MailAddress(usersByUserName.Email));
                         mailInfo.MailToAddressList = list;
                         mailInfo.MailBody          = "你在" + SiteConfig.SiteInfo.SiteName + "网站的用户新密码为" + newPassword + ",请及时到" + SiteConfig.SiteInfo.SiteUrl + "用户中心登录修改密码!";
                         mailInfo.Subject           = "新密码已发送到你的邮箱";
                         if (SendMail.Send(mailInfo) == MailState.Ok)
                         {
                             if (ApiData.IsAPiEnable())
                             {
                                 string str3 = ApiFunction.UpdateUser(usersByUserName.UserName, newPassword, null, null, null, null, null, null, null, null, null, null, null, null, null);
                                 if (str3 != "true")
                                 {
                                     DynamicPage.WriteErrMsg("<li>" + str3 + "</li>");
                                 }
                             }
                             if (Users.Update(usersByUserName))
                             {
                                 DynamicPage.WriteSuccessMsg("新密码已发送到你的邮箱!请注意查收并及时修改密码! 如无法接收到,请与网站管理员联系!", "../default.aspx");
                             }
                             else
                             {
                                 DynamicPage.WriteErrMsg("新密码已发送到你的邮箱!但网站系统无法修改旧密码,使用新密码可能无法登录! 请与网站管理员联系!", "../default.aspx");
                             }
                         }
                         else
                         {
                             DynamicPage.WriteErrMsg("新密码发送到你的邮箱时不成功,请与网站管理员联系!", "../default.aspx");
                         }
                     }
                     else
                     {
                         this.PnlStep3.Visible = true;
                     }
                 }
                 else
                 {
                     DynamicPage.WriteErrMsg("你回答的问题不对");
                 }
             }
             else if (SiteConfig.UserConfig.UserGetPasswordType != 0)
             {
                 string input = this.m_NewPassword;
                 usersByUserName.PayPassword = StringHelper.MD5(input);
                 MailInfo info3 = new MailInfo();
                 info3.FromName = SiteConfig.SiteInfo.WebmasterEmail;
                 List <MailAddress> list2 = new List <MailAddress>();
                 list2.Add(new MailAddress(usersByUserName.Email));
                 info3.MailToAddressList = list2;
                 info3.MailBody          = "你在" + SiteConfig.SiteInfo.SiteName + "网站的用户新预付款支付密码为" + input + ",请及时到" + SiteConfig.SiteInfo.SiteUrl + "用户中心登录修改预付款支付密码!";
                 info3.Subject           = "新预付款支付密码已发送到你的邮箱";
                 if (SendMail.Send(info3) == MailState.Ok)
                 {
                     if (Users.Update(usersByUserName))
                     {
                         DynamicPage.WriteSuccessMsg("新预付款支付密码已发送到你的邮箱!请注意查收并及时修改密码! 如无法接收到,请与网站管理员联系!", "../default.aspx");
                     }
                     else
                     {
                         DynamicPage.WriteErrMsg("新预付款支付密码已发送到你的邮箱!但网站系统无法修改旧密码,使用新密码可能无法登录! 请与网站管理员联系!", "../default.aspx");
                     }
                 }
                 else
                 {
                     DynamicPage.WriteErrMsg("新预付款支付密码发送到你的邮箱时不成功,请与网站管理员联系!", "../default.aspx");
                 }
             }
             else
             {
                 this.PalChangePayPassword.Visible = true;
             }
         }
     }
     else
     {
         DynamicPage.WriteErrMsg("你输入的验证码不对");
     }
 }
Пример #6
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            UserInfo info;
            bool     flag = false;
            int      num  = DataConverter.CLng(this.DropGroupId.SelectedValue);

            if (this.ViewState["UserInfo"] != null)
            {
                info = this.ViewState["UserInfo"] as UserInfo;
            }
            else
            {
                info = new UserInfo();
            }
            if (!string.IsNullOrEmpty(this.TxtQuestion.Text))
            {
                info.Question = this.TxtQuestion.Text;
            }
            if (!string.IsNullOrEmpty(this.TxtAnswer.Text))
            {
                info.Answer = StringHelper.MD5(this.TxtAnswer.Text);
            }
            info.GroupId        = num;
            info.Email          = this.TxtEmail.Text;
            info.UserFace       = this.TxtUserFace.Text;
            info.FaceWidth      = DataConverter.CLng(this.TxtFaceWidth.Text);
            info.FaceHeight     = DataConverter.CLng(this.TxtFaceHeight.Text);
            info.Sign           = this.TxtSign.Text;
            info.PrivacySetting = DataConverter.CLng(this.RadlPrivacySetting.SelectedValue);
            info.UserTrueName   = this.TxtTrueName.Text.Trim();
            ContacterInfo contacterInfo = new ContacterInfo();

            contacterInfo.ContacterId = DataConverter.CLng(this.HdnContacterID.Value);
            contacterInfo.UserName    = info.UserName;
            contacterInfo.TrueName    = this.TxtTrueName.Text;
            contacterInfo.Title       = this.TxtTitle.Text;
            this.PersonalInformation1.GetContacter(contacterInfo);
            this.LiaisonInformation1.GetContacter(contacterInfo);
            info.Sex = this.PersonalInformation1.UserSex;
            contacterInfo.Company        = this.TxtCompany.Text;
            contacterInfo.Department     = this.TxtDepartment.Text;
            contacterInfo.Position       = this.TxtPosition.Text;
            contacterInfo.Operation      = this.TxtOperation.Text;
            contacterInfo.CompanyAddress = this.TxtCompanyAddress.Text;
            contacterInfo.ClientId       = 0;
            contacterInfo.ParentId       = 0;
            contacterInfo.CreateTime     = DateTime.Now;
            contacterInfo.Owner          = "";
            contacterInfo.UserType       = ContacterType.EnterpriceMainContacter;
            contacterInfo.UpdateTime     = DateTime.Now;
            if (string.Compare(this.ViewState["action"].ToString(), "Add", StringComparison.OrdinalIgnoreCase) == 0)
            {
                info.UserName           = Users.UserNamefilter(this.TxtUserName.Text);
                info.UserPassword       = StringHelper.MD5(this.TxtUserPassword.Text.ToLower());
                info.JoinTime           = DateTime.Now;
                info.RegTime            = DateTime.Now;
                info.Status             = UserStatus.None;
                info.IsInheritGroupRole = true;
                contacterInfo.UserName  = info.UserName;
                if (Users.Exists(info.UserName))
                {
                    AdminPage.WriteSuccessMsg("<li>该用户名已被他人占用,请输入不同的用户名!</li>");
                }
                else
                {
                    if (ApiData.IsAPiEnable())
                    {
                        string str = ApiFunction.RegUser(info.UserName, this.TxtUserPassword.Text.ToLower(), info.Question, info.Answer, info.Email, contacterInfo.TrueName, contacterInfo.Sex.ToString(), contacterInfo.Birthday.ToString(), contacterInfo.QQ, contacterInfo.Msn, contacterInfo.Mobile, contacterInfo.OfficePhone, contacterInfo.Province, contacterInfo.City, contacterInfo.Address, contacterInfo.ZipCode, contacterInfo.Homepage);
                        if (str != "true")
                        {
                            AdminPage.WriteErrMsg(str + "<br><li>增加失败!</li>");
                        }
                    }
                    flag = Users.Add(info, contacterInfo);
                }
            }
            else
            {
                if (this.TxtUserPassword.Text != info.UserPassword)
                {
                    info.UserPassword = StringHelper.MD5(this.TxtUserPassword.Text.ToLower());
                }
                if (ApiData.IsAPiEnable())
                {
                    string str2 = ApiFunction.UpdateUser(info.UserName, this.TxtUserPassword.Text.ToLower(), info.Email, info.Question, this.TxtAnswer.Text, info.UserTrueName, info.Sex.ToString(), contacterInfo.Birthday.ToString(), contacterInfo.QQ, contacterInfo.Msn, contacterInfo.Mobile, contacterInfo.OfficePhone, contacterInfo.Address, contacterInfo.ZipCode, contacterInfo.Homepage);
                    if (str2 != "true")
                    {
                        AdminPage.WriteErrMsg("<li>" + str2 + "</li>");
                    }
                }
                flag = Users.Update(info, contacterInfo);
                if (info.UserType == UserType.Creator)
                {
                    this.Company1.Action    = this.ViewState["action"].ToString();
                    this.Company1.CompanyId = info.CompanyId;
                    Company.Update(this.Company1.CompanyInfo);
                }
            }
            string returnurl = "UserShow.aspx?UserID=" + info.UserId.ToString();

            if (DataConverter.CBoolean(BasePage.RequestString("Administrator")))
            {
                returnurl = "Administrator.aspx?UserName="******"<li>保存会员信息成功!</li>", returnurl);
            }
            else
            {
                AdminPage.WriteErrMsg("<li>保存会员信息失败!</li>");
            }
        }