manual validation code for login.
Posted: Tue Sep 18, 2018 10:43 pm
The code is written in the method of the form which is view model.
The error occurs while the iteration. It can go into while iteration but it doesn't read any user. I feel like the reason of errors is I 'm trying to get access to Dictionary which is located in the model view.
What did I do wrong?
The error occurs while the iteration. It can go into while iteration but it doesn't read any user. I feel like the reason of errors is I 'm trying to get access to Dictionary which is located in the model view.
What did I do wrong?
Code: Select all
loginValidation(id:String io; password:String io):Boolean;
vars
user:User;
iter:Iterator;
userDict:UserByID;
begin
userDict:=UserByID.firstInstance();
iter:=userDict.createIterator();
id:=id.trimBlanks();
password:=password.trimBlanks();
while iter.next(user) do
//write user.lastName;
if (user.identification = id or user.email=id)and (user.password=password)then
return true;
else
return false;
endif;
endwhile;
end;