public static DataTable GetEmailBookOfUser(Guid userGuid) { Business.EmailBook emailBookController = new Business.EmailBook(); Common.User user = Facade.User.LoadUser(userGuid); bool isAdmin = Helper.GetBool(user.IsAdmin.ToString()); return emailBookController.GetEmailBookUser(isAdmin, user.UserGuid, user.ParentGuid); }
public static string GetEmailBookOfUser(Guid userGuid, bool showEmailCount, bool showCheckBox) { Business.EmailBook emailBookController = new Business.EmailBook(); string tree = string.Empty; Common.User user = Facade.User.LoadUser(userGuid); bool isAdmin = Helper.GetBool(user.IsAdmin.ToString()); DataTable dataTableEmailBookUser = emailBookController.GetEmailBookUser(isAdmin, user.UserGuid, user.ParentGuid); DataTable dataTableRoot = emailBookController.GetRoot(); if (dataTableRoot.Rows.Count == 0) return string.Empty; Guid rootGuid = Helper.GetGuid(dataTableRoot.Rows[0]["Guid"].ToString()); tree += "<div class='myList'><ul class='browser filetree'>"; tree += string.Format("<li><span class='root folder' guid='{0}'>{1}{2}</span><ul id='child'>", Guid.Empty, showCheckBox ? "<input onclick='checkBoxControlChecked(this);' type='checkbox'/>" : string.Empty, dataTableRoot.Rows[0]["Name"].ToString()); GenerateTree(dataTableEmailBookUser, rootGuid, showEmailCount, showCheckBox, ref tree); tree += "</ul></li></ul></div>"; return tree; }