BaoKai_202508_Wms_Jingwang_.../WMS.FrmSystems/FrmSetPwd.cs
2025-08-24 21:52:42 +08:00

83 lines
2.2 KiB
C#

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<BussSystemUser>.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
}
}