Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected string ChildCompanies(Company c)
- {
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- Company parent = new Company(c.ParentId);
- CompanyCollection cc = new CompanyCollection();
- cc.Add(c);
- if (parent.CanIEdit(CurrentUser))
- {
- sb.AppendLine("[ ");
- sb.Append("{ attributes: { id : \"" + parent.ID + "\" }, data: \""+parent.CompanyName+"\"");
- sb.Append(", state: \"open\", children: " + ChildCompanies(cc));
- sb.Append("}");
- sb.AppendLine("]");
- }
- else
- {
- sb.Append(ChildCompanies(cc));
- }
- return sb.ToString();
- }
Add Comment
Please, Sign In to add comment