示例#1
0
 public string GetScriptOnLoad(int currentDepartmentId)
 {
     if (currentDepartmentId != 0)
     {
         var departmentInfo = DepartmentManager.GetDepartmentInfo(currentDepartmentId);
         if (departmentInfo != null)
         {
             string path;
             if (departmentInfo.ParentsCount <= 1)
             {
                 path = currentDepartmentId.ToString();
             }
             else
             {
                 path = departmentInfo.ParentsPath.Substring(departmentInfo.ParentsPath.IndexOf(",", StringComparison.Ordinal) + 1) + "," + currentDepartmentId;
             }
             return(DepartmentTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }
示例#2
0
 public string GetScriptOnLoad(int currentDepartmentID)
 {
     if (currentDepartmentID != 0)
     {
         var departmentInfo = DepartmentManager.GetDepartmentInfo(currentDepartmentID);
         if (departmentInfo != null)
         {
             var path = string.Empty;
             if (departmentInfo.ParentsCount <= 1)
             {
                 path = currentDepartmentID.ToString();
             }
             else
             {
                 path = departmentInfo.ParentsPath.Substring(departmentInfo.ParentsPath.IndexOf(",") + 1) + "," + currentDepartmentID.ToString();
             }
             return(DepartmentTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }