private void btnEditUser_Click(object sender, EventArgs e) { MemberInfo user = Users.GetUser(this.userId); if (!user.IsOpenBalance) { this.ShowMsg("该会员没有开启预付款账户,无法修改交易密码", false); } else if (string.IsNullOrEmpty(this.txtTransactionPassWord.Text) || this.txtTransactionPassWord.Text.Length > 20 || this.txtTransactionPassWord.Text.Length < 6) { this.ShowMsg("交易密码不能为空,长度限制在6-20个字符之间", false); } else if (this.txtTransactionPassWord.Text != this.txtTransactionPassWordCompare.Text) { this.ShowMsg("输入的两次密码不一致", false); } else if (MemberProcessor.ChangeTradePassword(user, this.txtTransactionPassWord.Text)) { Messenger.UserDealPasswordChanged(user, this.txtTransactionPassWord.Text); this.ShowMsg("交易密码修改成功", true); } else { this.ShowMsg("交易密码修改失败", false); } }
private void btnSetPassword_Click(object sender, EventArgs e) { MemberInfo user = HiContext.Current.User; bool flag = false; if (string.IsNullOrEmpty(this.txtPassword.Text.Trim()) || string.IsNullOrEmpty(this.txtRePassword.Text.Trim())) { this.ShowMessage("密码不允许为空!", false, "", 1); } else if (this.txtPassword.Text.Trim() != this.txtRePassword.Text.Trim()) { this.ShowMessage("两次输入的密码需一致", false, "", 1); } else if (this.txtPassword.Text.Length < 6 || this.txtPassword.Text.Length > HiConfiguration.GetConfig().PasswordMaxLength) { this.ShowMessage($"密码的长度只能在{6}和{HiConfiguration.GetConfig().PasswordMaxLength}个字符之间", false, "", 1); } else if (MemberProcessor.ChangeTradePassword(user, this.txtPassword.Text)) { Messenger.UserDealPasswordChanged(user, this.txtPassword.Text); string text = "/User/UserOrders?orderStatus=1"; text = ((!(this.source == "bdraw")) ? ((!(this.source == "sdraw")) ? (string.IsNullOrEmpty(this.orderId) ? "/User/UserOrders?orderStatus=1" : "/User/UserOrders?orderStatus=1") : "/User/SplittinDraws") : "/User/RequestBalanceDraw"); this.ShowMessage("交易密码重置成功", true, text, 2); } else { this.ShowMessage("交易密码修改失败,请重试", false, "", 1); } }
private void btnOK2_Click(object sender, EventArgs e) { MemberInfo user = HiContext.Current.User; if (user.TradePasswordSalt.ToLower() != "open" && user.TradePassword != Users.EncodePassword(this.txtOldTransactionPassWord.Text, user.TradePasswordSalt)) { this.ShowMessage(this.StatusTransactionPass, "当前交易密码输入错误", false); } else if (MemberProcessor.ChangeTradePassword(HiContext.Current.User, this.txtNewTransactionPassWord.Text)) { Messenger.UserDealPasswordChanged(HiContext.Current.User, this.txtNewTransactionPassWord.Text); this.ShowMessage(this.StatusTransactionPass, "你已经成功的修改了交易密码", true); } else { this.ShowMessage(this.StatusTransactionPass, "修改交易密码失败", false); } }