Skip to content

Instantly share code, notes, and snippets.

@joeygreen
Created March 25, 2014 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeygreen/9771108 to your computer and use it in GitHub Desktop.
Save joeygreen/9771108 to your computer and use it in GitHub Desktop.
divRollup.InnerHtml = "<strong>Using Employee.Manager(s)</strong><br /><br />";
if (emp.Manager != null)
{
divRollup.InnerHtml += "1 - " + emp.Manager.EmployeeFullName + "<br />";
if (emp.Manager.Superior != null)
{
divRollup.InnerHtml += "2 - " + emp.Manager.Superior.FullName + "<br />";
if (emp.Manager.Superior.Superior != null)
{
divRollup.InnerHtml += "3 - " + emp.Manager.Superior.Superior.FullName + "<br />";
if (emp.Manager.Superior.Superior.Superior != null)
{
divRollup.InnerHtml += "4 - " + emp.Manager.Superior.Superior.Superior.FullName + "<br />";
if (emp.Manager.Superior.Superior.Superior.Superior != null)
{
divRollup.InnerHtml += "5 - " + emp.Manager.Superior.Superior.Superior.Superior.FullName + "<br />";
if (emp.Manager.Superior.Superior.Superior.Superior.Superior != null)
{
divRollup.InnerHtml += "6 - " + emp.Manager.Superior.Superior.Superior.Superior.Superior.FullName + "<br />";
}
@joeygreen
Copy link
Author

This is by far my favorite chunk of code I've found in the workplace codebase so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment