예제 #1
0
        internal void InitRoomLinks(IQueryAdapter dbClient)
        {
            this.roomLinks = new Dictionary <uint, List <RoomLinkInformation> >();

            dbClient.setQuery("SELECT * FROM room_links");
            DataTable roomLinkData = dbClient.getTable();

            foreach (DataRow Row in roomLinkData.Rows)
            {
                RoomLinkInformation info = new RoomLinkInformation(Row);

                if (roomLinks.ContainsKey(info.roomID))
                {
                    roomLinks[info.roomID].Add(info);
                }
                else
                {
                    List <RoomLinkInformation> newList = new List <RoomLinkInformation>();
                    newList.Add(info);
                    roomLinks.Add(info.roomID, newList);
                }
            }


            dbClient.setQuery("SELECT id,caption,min_rank FROM navigator_flatcats WHERE enabled = 2");
            DataTable dPrivCats = dbClient.getTable();

            int    categoryID;
            string caption;

            foreach (DataRow dRow in dPrivCats.Rows)
            {
                categoryID = (int)dRow[0];
                caption    = (string)dRow[1];

                RoomCategory category = new RoomCategory(categoryID, caption);
                roomCategories.Add(categoryID, category);
            }
        }
예제 #2
0
        internal void InitRoomLinks(IQueryAdapter dbClient)
        {
            this.roomLinks = new Dictionary<uint, List<RoomLinkInformation>>();

            dbClient.setQuery("SELECT * FROM room_links");
            DataTable roomLinkData = dbClient.getTable();

            foreach (DataRow Row in roomLinkData.Rows)
            {
                RoomLinkInformation info = new RoomLinkInformation(Row);

                if (roomLinks.ContainsKey(info.roomID))
                {
                    roomLinks[info.roomID].Add(info);
                }
                else
                {
                    List<RoomLinkInformation> newList = new List<RoomLinkInformation>();
                    newList.Add(info);
                    roomLinks.Add(info.roomID, newList);
                }
            }

            dbClient.setQuery("SELECT id,caption,min_rank FROM navigator_flatcats WHERE enabled = 2");
            DataTable dPrivCats = dbClient.getTable();

            int categoryID;
            string caption;
            foreach (DataRow dRow in dPrivCats.Rows)
            {
                categoryID = (int)dRow[0];
                caption = (string)dRow[1];

                RoomCategory category = new RoomCategory(categoryID, caption);
                roomCategories.Add(categoryID, category);
            }
        }