using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WMS.Model.Base; using WMS.Common; using WMS.Frm.Base; using WMS.Business; using WMS.Business.Base; namespace WMS.FrmSystems { public partial class FrmSetPwd : FormBase { #region 全局变量声明 //获得前一界面 双击或点击修改的行数据 public UserDataModel SourceModel; public string UserModel; #endregion public FrmSetPwd(UserDataModel userModel) { SourceModel = userModel; UserModel= Newtonsoft.Json.JsonConvert.SerializeObject(SourceModel); InitializeComponent(); } #region 密码验证 public void validatePwd() { if (txtOldPwd.Text.Trim() != SourceModel.PASSWORD) { SystemCommon.ShowInfoMessageBox("旧密码不正确,请重新输入!"); txtOldPwd.Focus(); return ; } else { if (txtPwd.Text.Trim() != txtNewPwd.Text.Trim()) { SystemCommon.ShowInfoMessageBox("两次输入密码不同,请重新输入!"); txtNewPwd.Focus(); return; } } } #endregion #region 确定事件 private void btnAccept_Click(object sender, EventArgs e) { //验证密码 validatePwd(); string errtex = IBussFactory.Instance().resetPwd(txtPwd.Text.Trim(),SourceModel.USER_ID); if (!string.IsNullOrEmpty(errtex)) { SystemCommon.ShowInfoMessageBox("操作失败!"); } else { SystemCommon.ShowInfoMessageBox("操作成功!"); this.Close(); } } #endregion #region 关闭窗体 private void btnClose_Click(object sender, EventArgs e) { this.Close(); } #endregion } }