Guest User

Untitled

a guest
Jul 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. protected string ChildCompanies(Company c)
  2. {
  3. System.Text.StringBuilder sb = new System.Text.StringBuilder();
  4. Company parent = new Company(c.ParentId);
  5. CompanyCollection cc = new CompanyCollection();
  6. cc.Add(c);
  7. if (parent.CanIEdit(CurrentUser))
  8. {
  9. sb.AppendLine("[ ");
  10. sb.Append("{ attributes: { id : \"" + parent.ID + "\" }, data: \""+parent.CompanyName+"\"");
  11. sb.Append(", state: \"open\", children: " + ChildCompanies(cc));
  12. sb.Append("}");
  13. sb.AppendLine("]");
  14. }
  15. else
  16. {
  17. sb.Append(ChildCompanies(cc));
  18. }
  19. return sb.ToString();
  20. }
Add Comment
Please, Sign In to add comment