pass value from class to form .

Dear all,

Greetings, a very good day for you , now i have a class which select data from table using self join , and i have a tree in my form ,I’d like to select item from tree and pass it to method in the class as a parameter ,than bound the grid with the result from method can you help me ,many thanks.

there is the code for method

//this method to set DS_ID to get his Parent.
str GetParent(EmplId Sons)
str FindParent;
While SELECT DS_Parent FROM dS_Relative1
JOIN dS_Relative2
where dS_Relative1.DS_ID == dS_Relative2.DS_Parent
&& dS_Relative1.DS_ID == Sons
FindParent +=dS_Relative1.DS_Parent;
return FindParent;