Exemplo n.º 1
0
        public string RightColumnGetAllJoinedGroups()
        {
            GroupsDAL groupsDal = new GroupsDAL();

            List <Group> groupList = new List <Group>();

            groupList = groupsDal.GetAllMembersGroups(aMember);
            int           groupCount = groupList.Count;
            StringBuilder groups     = new StringBuilder();

            for (int i = 0; i < groupCount; ++i)
            {
                groups.Append("<li><a class = 'btnGoToGroupPage' id='");
                groups.Append(groupList[i].GroupId);
                groups.Append("' >");
                groups.Append(groupList[i].GroupDescription);
                groups.Append("</a></li>");
            }
            return(groups.ToString());
        }
Exemplo n.º 2
0
        public string RightColumnGet5JoinedGroups()
        {
            GroupsDAL groupsDal = new GroupsDAL();

            List <Group> groupList = new List <Group>();

            groupList = groupsDal.GetAllMembersGroups(aMember);
            int           groupCount = groupList.Count;
            StringBuilder groups     = new StringBuilder();

            if (groupCount > 5)
            {
                for (int i = 0; i < 5; ++i)
                {
                    groups.Append("<li><a class = 'btnGoToGroupPage' id='");
                    groups.Append(groupList[i].GroupId);
                    groups.Append("' >");
                    groups.Append(groupList[i].GroupDescription);
                    groups.Append("</a></li>");
                }

                MasterPage  master = new MasterPage();
                HiddenField h      = (HiddenField)master.FindControl("StayExpanded"); //
                try
                {
                    if (h.Value != null)
                    {
                        if (h.Value == "expanded")
                        {
                            for (int i = 5; i < groupList.Count; ++i)
                            {
                                groups.Append("<li class='groupsToHihe'><a class = 'btnGoToGroupPage' id='");
                                groups.Append(groupList[i].GroupId);
                                groups.Append("' >");
                                groups.Append(groupList[i].GroupDescription);
                                groups.Append("</a></li>");
                            }
                        }
                    }
                    else
                    {
                        for (int i = 5; i < groupList.Count; ++i)
                        {
                            groups.Append("<li style='display: none;' class='groupsToHihe'><a class = 'btnGoToGroupPage' id='");
                            groups.Append(groupList[i].GroupId);
                            groups.Append("' >");
                            groups.Append(groupList[i].GroupDescription);
                            groups.Append("</a></li>");
                        }
                    }
                }
                catch {
                    for (int i = 5; i < groupList.Count; ++i)
                    {
                        groups.Append("<li style='display: none;' class='groupsToHihe'><a class = 'btnGoToGroupPage' id='");
                        groups.Append(groupList[i].GroupId);
                        groups.Append("' >");
                        groups.Append(groupList[i].GroupDescription);
                        groups.Append("</a></li>");
                    }
                }
            }
            else
            {
                for (int i = 0; i < groupCount; ++i)
                {
                    groups.Append("<li><a class = 'btnGoToGroupPage' id='");
                    groups.Append(groupList[i].GroupId);
                    groups.Append("' >");
                    groups.Append(groupList[i].GroupDescription);
                    groups.Append("</a></li>");

                    //richTextBox6.Text += groupList[i].GroupId + "\t";
                    //richTextBox6.Text += groupList[i].GroupDescription + "\n";
                }
            }
            return(groups.ToString());
        }