Пример #1
0
        public static string GetHotelName(string id)
        {
            dezerialize       des    = new dezerialize();
            List <HotelsList> hotels = des.dezerializeHotels();

            foreach (HotelsList H in hotels)
            {
                if (H.id == id)
                {
                    return(H.name);
                }
            }
            return(null);
        }
Пример #2
0
        public string randomRoomId()
        {
            dezerialize      a        = new dezerialize();
            List <RoomTypes> roomList = a.dezerializeRoomTypes();
            Random           rnd      = new Random(Environment.TickCount);

            number = rnd.Next(1, 5);
            switch (number)
            {
            case 1:
                return(roomList[0].id);

            case 2:
                return(roomList[1].id);

            case 3:
                return(roomList[2].id);

            case 4:
                return(roomList[3].id);
            }
            return(null);
        }