public ActionResult DreamList(int id)
 {
     if (ibo != null)
     {
         List <Dream> dreams = IBOVirtualAPI.GetDreamsUserLevel(ibo.IBONum, id.ToString());
         if ((dreams.Count > 0) || (id == 0))
         {
             ViewBag.dreamLevel = id;
             ViewBag.nextLevel  = id + 1;
             List <Dream> dreamsLevel = IBOVirtualAPI.GetDreamsUserLevel(ibo.IBONum, (id + 1).ToString());
             Dictionary <Timeframe, Dream> timeframeDreams = new Dictionary <Timeframe, Dream>();
             List <Timeframe> timeframes = IBOVirtualAPI.GetTimeFrames(id, ibo.languageId);
             Timeframe        last       = timeframes.Last();
             if (dreamsLevel.Count < 1)
             {
                 ViewBag.lastItem = last;
             }
             foreach (Timeframe time in timeframes)
             {
                 Dream dream = (from d in dreams
                                where d.timeframeId == time.timeframeId
                                select d).FirstOrDefault();
                 timeframeDreams.Add(time, dream);
             }
             return(PartialView(timeframeDreams));
         }
     }
     return(null);
 }