public static string GetCurrentTime(int groupId, string startDate, string endDate) { ScheduleBLL scheduleBLL = new ScheduleBLL(); scheduleBLL.readGroupSchedule(groupId, Util.StringToDate(startDate), Util.StringToDate(endDate)); List <Schedule> dss = scheduleBLL.scheduleList; List <string> allcells = new List <string>(); List <TimeCell> tmCells = new List <TimeCell>(); foreach (Schedule s in dss) { List <String> cells = convertTimeLinetoTimeCell(s.freeSlotTimeFrom, s.freeSlotTimeTo); foreach (String c in cells) { TimeCell tc = new TimeCell(); tc.cell = c; tc.colorCode = s.colorCode; tc.userId = s.userId; tc.userName = s.user.firstName + " " + s.user.lastName; addTimeCell(tmCells, tc); } // allcells.AddRange(cells); } String json = tmCells.ToJSON(); return(json); }