procedure TMainForm.btnChangePasswordClick(Sender: TObject);
var
lPerson: Org.TPerson;
begin
lPerson := Org.OrgSys.OrgSystem.GetPerson('ry1');
If Assigned(lPerson) then
begin
lPerson.Password := '12345';
// Org.OrgSys.OrgSystem.SaveUnit(lPerson);
Dialogs.ShowMessage('密码修改成功,新密码为12345');
end;
end;
function TBizSysUtils.SetPassword(const Person: TBizURL): Boolean;
var
lPassword: string;
lPerson: TPerson;
lCaption: string;
begin
Result := False;
lPerson := TPerson(OrgSys.OrgSystem.GetUnit(Person));
if Assigned(lPerson) then
begin
lPassword := lPerson.Password;
lCaption := Format(Msg_SetPassword, [lPerson.DisplayName]);
Result := ChangePassword(lPassword, lCaption);
if Result then
begin
lPerson.Password := lPassword;
// OrgSys.OrgSystem.SaveUnit(lPerson);
end;
end;
end