private void btnSure_Click(object sender, EventArgs e) { try { if (txtOriginalPassword.Text.Trim() == string.Empty) { MessageBoxs.Show(Trans.COM, this.ToString(), "原密码不可为空", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!LoginInfoDAX.UserPassword.Equals(CryptoHelp.EncodeToMD5(txtOriginalPassword.Text.Trim()))) { MessageBoxs.Show(Trans.COM, this.ToString(), "原密码错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtNewPassword.Text.Trim() == string.Empty) { MessageBoxs.Show(Trans.COM, this.ToString(), "新密码不可为空", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtNewPassword.Text.Trim() != txtSurePassword.Text.Trim()) { MessageBoxs.Show(Trans.COM, this.ToString(), "新密码和确认密码不一致", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult dr = MessageBoxs.Show(Trans.COM, this.ToString(), "您将要修改密码!\r\n单击【确定】继续,【取消】返回。", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr != DialogResult.OK) { return; } MDLSM_User userQuery = new MDLSM_User(); userQuery.WHERE_User_ID = LoginInfoDAX.UserID; MDLSM_User userResult = new MDLSM_User(); _bll.QueryForObject <MDLSM_User, MDLSM_User>(userQuery, userResult); userResult.WHERE_User_ID = LoginInfoDAX.UserID; userResult.WHERE_User_VersionNo = userResult.User_VersionNo; userResult.User_Password = CryptoHelp.EncodeToMD5(txtNewPassword.Text.Trim()); userResult.User_VersionNo += 1; bool boolTmp = _bll.Save <MDLSM_User>(userResult); if (!boolTmp) { MessageBoxs.Show(Trans.COM, this.ToString(), "保存失败!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { MessageBoxs.Show(Trans.COM, this.ToString(), "保存成功!", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); _supplierMain.DialogResult = DialogResult.Yes; _supplierMain.Close(); _flg.Show(); } } catch (Exception ex) { MessageBoxs.Show(Trans.COM, this.ToString(), ex.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); LogHelper.WriteErrorLog(Trans.COM, System.Reflection.MethodBase.GetCurrentMethod().ToString() + SysConst.ENTER + ex.StackTrace, ex.Message, null, ex); } }
/// <summary> /// 将【详情】Tab内控件的值赋值给基类的DetailDS /// </summary> private void SetCardCtrlsToDetailDS() { DetailDS = new UserManagerUIModel { //用户ID User_ID = txtUser_ID.Text.Trim(), //姓名 User_Name = txtUser_Name.Text.Trim(), //工号 User_EMPNO = txtUser_EMPNO.Text.Trim(), //身份证号 User_IDNo = txtUser_IDNo.Text.Trim(), //性别 User_Sex = cbUser_Sex.Text.Trim(), //地址 User_Address = txtUser_Address.Text.Trim(), //电话号码 User_PhoneNo = txtUser_PhoneNo.Text.Trim(), //是否允许微信认证 User_IsAllowWechatCertificate = ckUser_IsAllowWechatCertificate.Checked, //是否已微信认证 User_IsWechatCertified = ckUser_IsWechatCertified.Checked, //打印标题前缀 User_PrintTitlePrefix = txtUser_PrintTitlePrefix.Text.Trim(), //有效 User_IsValid = ckUser_IsValid.Checked, //创建人 User_CreatedBy = txtUser_CreatedBy.Text, //创建时间 User_CreatedTime = (DateTime?)dtUser_CreatedTime.Value ?? BLLCom.GetCurStdDatetime(), //修改人 User_UpdatedBy = txtUser_UpdatedBy.Text, //修改时间 User_UpdatedTime = (DateTime?)dtUser_UpdatedTime.Value ?? BLLCom.GetCurStdDatetime(), //版本号 User_VersionNo = Convert.ToInt64(txtUser_VersionNo.Text.Trim() == "" ? "1" : txtUser_VersionNo.Text.Trim()), }; //密码 string encodePassword = null; if (!string.IsNullOrEmpty(txtUser_Password.Text.Trim())) { if (txtUser_Password.Text.Trim() != _oldPassword) { encodePassword = CryptoHelp.EncodeToMD5(txtUser_Password.Text.Trim()); } else { encodePassword = txtUser_Password.Text.Trim(); } } else { encodePassword = CryptoHelp.EncodeToMD5(SysConst.USER_INITIAL_PASSWORD); } DetailDS.User_Password = encodePassword; }
/// <summary> /// 前端检查-提现 /// </summary> /// <returns></returns> private bool ClientCheckForWithdrawal() { //验证密码 if (string.IsNullOrEmpty(txtWal_TradingPassword.Text.Trim())) { MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { MsgParam.PASSWORD }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (_withdrawalInfo.Wal_TradingPassword != CryptoHelp.EncodeToMD5(txtWal_TradingPassword.Text.Trim())) { //密码错误 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0011, new object[] { MsgParam.PASSWORD }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //验证钱包 if (string.IsNullOrEmpty(txtWal_No.Text)) { //没有获取到钱包,提现失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } WalletInfoUIModel curWallet = BLLCom.GetWalletByWalletNo(txtWal_No.Text); if (string.IsNullOrEmpty(curWallet.Wal_ID) || string.IsNullOrEmpty(curWallet.Wal_No)) { //没有获取到钱包,提现失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //验证本次提现金额 if (numThisWithdrawalAmount.Value == null || Convert.ToDecimal(numThisWithdrawalAmount.Value) == 0) { //本次提现金额不能为零! MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { MsgParam.WITHDRAWALAMOUNT_CANNOTZERO }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (curWallet.Wal_AvailableBalance < Convert.ToDecimal(numThisWithdrawalAmount.Value)) { //提现金额大于钱包可用余额,不能提现! MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0017, new object[] { "提现金额大于钱包可用余额", SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //确定要提现吗? DialogResult dialogResult = MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.I_0003, new object[] { SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult != DialogResult.OK) { return(false); } return(true); }
/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { //验证所有人类别 if (string.IsNullOrEmpty(mcbWal_OwnerTypeName.SelectedText)) { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { MsgParam.OWNER_TYPE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //所有人类别为{平台内汽修商}的场合,验证汽修商户和汽修商组织 if (mcbWal_OwnerTypeName.SelectedText == CustomerTypeEnum.Name.PTNQXSH) { if (string.IsNullOrEmpty(mcbAutoFactoryName.SelectedValue) || string.IsNullOrEmpty(mcbAutoFactoryName.SelectedText)) { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { MsgParam.AUTOFACTORY }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (string.IsNullOrEmpty(txtWal_AutoFactoryOrgCode.Text)) { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { MsgParam.AUTOFACTORY_ORG }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } } //验证开户人 if (string.IsNullOrEmpty(mcbClientName.SelectedText)) { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, new object[] { MsgParam.ACCOUNT_BY }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //验证交易密码 if (string.IsNullOrEmpty(txtWal_TradingPassword.Text) && string.IsNullOrEmpty(txtConfirmTradingPassword.Text)) { //获取系统配置中的电子钱包初始密码 var resultParameters = CacheDAX.Get(CacheDAX.CacheKey.S1006) as List <MDLSM_Parameter>; if (resultParameters != null && resultParameters.Count > 0) { txtConfirmTradingPassword.Text = txtWal_TradingPassword.Text = CryptoHelp.EncodeToMD5(resultParameters[0].Para_Value1); } else { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "1006(钱包初始密码)未在SM_Parameter表中配置" }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } } else { //交易密码和确认密码不一致 if (txtWal_TradingPassword.Text != txtConfirmTradingPassword.Text) { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "交易密码和确认密码不一致" }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (txtWal_TradingPassword.Text != null) { //加密 txtWal_TradingPassword.Text = CryptoHelp.EncodeToMD5(txtWal_TradingPassword.Text); txtConfirmTradingPassword.Text = txtWal_TradingPassword.Text; } else { //获取系统配置中的电子钱包初始密码 var resultParameters = CacheDAX.Get(CacheDAX.CacheKey.S1006) as List <MDLSM_Parameter>; if (resultParameters != null && resultParameters.Count > 0) { txtWal_TradingPassword.Text = CryptoHelp.EncodeToMD5(resultParameters[0].Para_Value1); txtConfirmTradingPassword.Text = txtWal_TradingPassword.Text; } else { MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "1006(钱包初始密码)未在SM_Parameter表中配置" }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } } } return(true); }