Esempio n. 1
0
 private static void BuildUserGroupTree(Session session, UserGroup group, StringBuilder builder, bool showCheckbox)
 {
     builder.Append("<li>");
     if (showCheckbox)
         builder.Append("<input type='checkbox' style='width:14px;height:14px; border:0; font-size:12px;margin-top:1px;margin-bottom:0;' />");
     builder.AppendFormat("<span oid=\"{0}\">", group.GroupId)
               .Append(group.ToString())
               .Append("</span>");
     if (group.Children != null && group.Children.Count > 0)
     {
         builder.Append("<ul>");
         foreach (UserGroup g in group.Children)
             BuildUserGroupTree(session, g, builder, showCheckbox);
         builder.Append("</ul>");
     }
     builder.Append("</li>");
 }
Esempio n. 2
0
    private static void BuildMsgSubscriberUserGroupTree(Session session, UserGroup group, StringBuilder builder, DataTable dtGroupId)
    {
        builder.Append("<li>");

        if (dtGroupId != null)
        {
            DataRow[] rows = dtGroupId.Select(string.Format("GroupId={0}", group.GroupId));
            if (rows != null && rows.Length > 0)
            {
                dtGroupId.Rows.Remove(rows[0]);
                builder.Append("<span>&radic;</span>");
            }
            else
            {
                builder.Append("<input type='checkbox' style='width:14px;height:14px; border:0; font-size:12px;margin-top:1px;margin-bottom:0;' />");
            }
        }
        builder.AppendFormat("<span oid=\"{0}\">", group.GroupId)
                  .Append(group.ToString())
                  .Append("</span>");

        if (group.Children != null && group.Children.Count > 0)
        {
            builder.Append("<ul>");
            foreach (UserGroup g in group.Children)
                BuildMsgSubscriberUserGroupTree(session, g, builder, dtGroupId);
            builder.Append("</ul>");
        }
        builder.Append("</li>");
    }