C # statement of ternary operators: three operands A1, A2, and A3 expressions a1 = A2> A3? A2: A3 indicates that if A2> A3, a1 = a2, otherwise a1 = A3
Returns the first traversal element:
///
/// return the path of the current column, no more than Level 3
///
///
///
//
Public String getnodepath (ym_columns YC, list yclist)
{< br> If (YC. fatherid = 0)
return YC. ID + suffix;
else
{< br> ym_columns parent1 = yclist. find (o) => {return O. id = YC. fatherid;}); // The find method is to traverse the list yclist, Returns the first matched element
If (parent1.fatherid! = 0)
{< br> ym_columns parent2 = yclist. find (o) => {return O. id = parent1.fatherid;});
If (parent2.fatherid = 0)
{< br> return parent2.id + suffix + "/" + parent1.id + suffix + "/" + YC. ID + suffix;
}< br> else
{< br> return "path error ";
}< BR >}< br> else
return parent1.id + suffix + "/" + YC. ID + suffix;
}< BR >}