コード例 #1
0
        /// <summary>
        ///     Returns a list of buildings
        /// </summary>
        /// <param name="institute">The Institute the Buildings are in</param>
        /// <returns>A LinkedList of Buildings</returns>
        public LinkedList loadBuildingList(Institute institute)
        {
            LinkedList buildingList = new LinkedList();
            Building tempBuild;
            string sqlStatment = "SELECT * FROM Building";
            try
            {
                OpenConection();
                cmd = new OleDbCommand(sqlStatment, conn);
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    if (reader["Deleted"].ToString().Equals("False"))
                    {
                        tempBuild = new Building();
                        tempBuild.setId(reader["ID"].ToString());
                        tempBuild.setName("Building_Name");
                        tempBuild.setRoomList(loadRoomList(tempBuild));
                        buildingList.addAtTail(tempBuild);
                    }
                }
                CloseConnection();
            }
            catch
            {

            }
            return buildingList;
        }