Beispiel #1
0
 internal void CreateGroupForum(uint groupid, int canreadforum, int canwriteforum, int cancreateforum, int canmoderateforum)
 {
     Forum = new GroupForum(groupid, canreadforum, canwriteforum, cancreateforum, canmoderateforum, false);
 }
Beispiel #2
0
        internal GroupItem(DataRow dRow)
        {
            Id                = Convert.ToUInt32(dRow["id"]);
            Name              = (string)dRow["name"];
            Description       = (string)dRow["description"];
            RoomId            = Convert.ToUInt32(dRow["roomid"]);
            CustomColor1      = (int)dRow["customcolor1"];
            CustomColor2      = (int)dRow["customcolor2"];
            temChat           = OtanixEnvironment.EnumToBool((string)dRow["temChat"]);
            GroupBase         = (int)dRow["groupbase"];
            GroupBaseColor    = (int)dRow["groupbasecolor"];
            GroupBasePosition = (int)dRow["groupbaseposition"];
            var zGroupItem1 = ((string)dRow["groupitem1"]).Split(';');

            if (zGroupItem1.Count() == 3)
            {
                GroupItem1 = new int[] { int.Parse(zGroupItem1[0]), int.Parse(zGroupItem1[1]), int.Parse(zGroupItem1[2]) }
            }
            ;
            var zGroupItem2 = ((string)dRow["groupitem2"]).Split(';');

            if (zGroupItem2.Count() == 3)
            {
                GroupItem2 = new int[] { int.Parse(zGroupItem2[0]), int.Parse(zGroupItem2[1]), int.Parse(zGroupItem2[2]) }
            }
            ;
            var zGroupItem3 = ((string)dRow["groupitem3"]).Split(';');

            if (zGroupItem3.Count() == 3)
            {
                GroupItem3 = new int[] { int.Parse(zGroupItem3[0]), int.Parse(zGroupItem3[1]), int.Parse(zGroupItem3[2]) }
            }
            ;
            var zGroupItem4 = ((string)dRow["groupitem4"]).Split(';');

            if (zGroupItem4.Count() == 3)
            {
                GroupItem4 = new int[] { int.Parse(zGroupItem4[0]), int.Parse(zGroupItem4[1]), int.Parse(zGroupItem4[2]) }
            }
            ;
            GroupImage  = (string)dRow["groupimage"];
            HtmlColor1  = (string)dRow["htmlcolor1"];
            HtmlColor2  = (string)dRow["htmlcolor2"];
            DateCreated = (string)dRow["datecreated"];
            OwnerId     = Convert.ToUInt32(dRow["ownerid"]);
            OwnerName   = UsersCache.getUsernameById(OwnerId);
            Type        = Convert.ToInt32(dRow["type"]);
            RightsType  = Convert.ToInt32(dRow["rightsType"]);

            using (IQueryAdapter dbClient = OtanixEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT COUNT(*) FROM groups_users WHERE groupid = '" + Id + "' AND acepted = '1'");
                MembersCount = dbClient.getInteger();

                dbClient.setQuery("SELECT * FROM groups_forums WHERE groupid = " + Id);
                DataRow dForum = dbClient.getRow();

                if (dForum != null)
                {
                    Forum = new GroupForum(Id, Convert.ToInt32(dForum["can_read"]), Convert.ToInt32(dForum["can_write"]), Convert.ToInt32(dForum["can_create"]), Convert.ToInt32(dForum["can_moderate"]), true);
                }
            }
        }